Skip to content

Running InVesalius 3 in Mac

Thiago Franco de Moraes edited this page Oct 24, 2023 · 19 revisions

This guide is based on High Sierra. This first step is the installation of homebrew. Access the homebrew site to know how to install it.

We recommend to install the python3 from brew, also install OpenMP (we use it):

brew install python3 libomp

If you are working with a Apple silicon Mac you also have to install the hdf5:

brew install hdf5

Clone InVesalius 3 using git:

git clone --recurse-submodules https://github.com/invesalius/invesalius3

To run the following commands your shell must be inside the InVesalius folder:

cd invesalius3

Install InVesalius main dependencies wxpython, numpy, scipy, VTK, GDCM, imageio, scikit-image, Pillow, Pyserial, PSUtil, nibabel, configparser, H5py, PyPubsub and plaidml using pip:

pip3 install -r requirements.txt

If you are using Mac with Apple silicon you need to export some environment variable before the next step:

export CFLAGS="-I/opt/homebrew/opt/libomp/include"
export CPPFLAGS="-I/opt/homebrew/opt/libomp/include"
export LDFLAGS="-L/opt/homebrew/opt/libomp/lib"

Compile the cython packages used by InVesalius:

python3 setup.py build_ext --inplace

Now your system is ready to run InVesalius directly from the source code. Just enter in the InVesalius 3 source and run it.

python3 app.py

If you have this error:

This program needs access to the screen. Please run with a
Framework build of python, and only when you are logged in
on the main display of your Mac.

Run InVesalius using this command:

pythonw app.py
Clone this wiki locally