invesalius / invesalius3

3D medical imaging reconstruction software
https://invesalius.github.io/
GNU General Public License v2.0
630 stars 287 forks source link

ImportError: libgdcmMEXD.so.2.8: cannot open shared object file: No such file or directory #276

Closed kecaj closed 3 years ago

kecaj commented 3 years ago

Trying to follow the installation instructions on Fedora 34.

(invesalius-venv) [jacek@fedora invesalius3]$ python3 app.py
Traceback (most recent call last):
  File "/home/jacek/Play/invesalius/invesalius-venv/lib64/python3.9/site-packages/gdcm/gdcmswig.py", line 17, in swig_import_helper
    return importlib.import_module(mname)
  File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 565, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1173, in create_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
ImportError: libgdcmMEXD.so.2.8: cannot open shared object file: No such file or directory

However, I do have libgdcmMEXD.so.3.0.8 instead of libgdcmMEXD.so.2.8 :

(invesalius-venv) [jacek@fedora invesalius3]$ sudo ldconfig -v | grep -i gdcm
[sudo] password for jacek: 
ldconfig: Can't stat /libx32: No such file or directory
ldconfig: Path `/usr/lib' given more than once
(from <builtin>:0 and <builtin>:0)
ldconfig: Path `/usr/lib64' given more than once
(from <builtin>:0 and <builtin>:0)
ldconfig: Can't stat /usr/libx32: No such file or directory
    libgdcmmd5.so.3.0 -> libgdcmmd5.so.3.0.8
    libgdcmjpeg8.so.3.0 -> libgdcmjpeg8.so.3.0.8
    libgdcmjpeg16.so.3.0 -> libgdcmjpeg16.so.3.0.8
    libgdcmjpeg12.so.3.0 -> libgdcmjpeg12.so.3.0.8
    libgdcmMSFF.so.3.0 -> libgdcmMSFF.so.3.0.8
    libgdcmMEXD.so.3.0 -> libgdcmMEXD.so.3.0.8
    libgdcmIOD.so.3.0 -> libgdcmIOD.so.3.0.8
    libgdcmDSED.so.3.0 -> libgdcmDSED.so.3.0.8
    libgdcmDICT.so.3.0 -> libgdcmDICT.so.3.0.8
    libgdcmCommon.so.3.0 -> libgdcmCommon.so.3.0.8

What could I do to get Invesalius to run?

tfmoraes commented 3 years ago

Hi @kecaj. If you just want to run InVesalius you can run it using flatpak https://flathub.org/apps/details/br.gov.cti.invesalius

If you want to run from source code, there is requirements.txt inside InVesalius. Just run:

pip install -r requirements.txt

To install all the needed libs. Unfortunately, there is no VTK9.0.1 wheel to Python3.9. What you can do is change the version of VTK to 9.0.20210612.dev0 in the requirements.txt. There is not a WXPython wheel to Linux too, but pip will compile it to you, you just need to install some packages before run pip install -r requirements.txt:

dnf -y install gcc-c++ python3-devel  freeglut-devel gstreamer1-devel gstreamer1-plugins-base-devel  gtk3-devel libjpeg-turbo-devel libnotify-devel libpng-devel libSM-devel libtiff-devel libXtst-devel SDL-devel webkit2gtk3-devel which
kecaj commented 3 years ago

Thank you for your thoughtful feedback.

The mistake I made was installing plaidml-keras in a virtual environment instead of using pip install --user.

When I followed the instructions precisely, invesalius ran as expected.