Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'vtkmodules' #34

Open
mxochicale opened this issue Jan 18, 2023 · 2 comments
Open

ModuleNotFoundError: No module named 'vtkmodules' #34

mxochicale opened this issue Jan 18, 2023 · 2 comments

Comments

@mxochicale
Copy link
Contributor

I am trying to run python scikit-surgerytutorial01/sksurgerytutorial01/vtkoverlay_app.py under ubuntu 22.04x64 and got the following error:

Traceback (most recent call last):
  File "vtkoverlay_app.py", line 8, in <module>
    from sksurgeryutils.common_overlay_apps import OverlayBaseWidget
  File "/home/mxochicale/anaconda3/envs/scikit-surgeryvtkVEVE/lib/python3.7/site-packages/sksurgeryutils/common_overlay_apps.py", line 15, in <module>
    from sksurgeryvtk.widgets.vtk_overlay_window import VTKOverlayWindow
  File "/home/mxochicale/anaconda3/envs/scikit-surgeryvtkVEVE/lib/python3.7/site-packages/sksurgeryvtk/widgets/vtk_overlay_window.py", line 35, in <module>
    from vtkmodules.qt.QVTKRenderWindowInteractor import \
ModuleNotFoundError: No module named 'vtkmodules'

It seems that scikit-surgeryutils>=1.2.0 install scikit-surgeryvtk v1.1.0, conflicting with the working version scikit-surgeryvtk v1.0.6.

One way to solve this is to downgraded scikit-surgeryvtk to v1.0.6 in the conda environment:

name: scikit-surgeryTUTORIAL01VE
channels:
  - defaults
  - conda-forge #vtk; tox; tbb-devel
  - anaconda #coverage; scipy; pyserial 
dependencies:
  - python=3.7
  - numpy>=1.17.4
  - vtk=8.1.2
  - tox>=3.26.0
  - pytest>=7.1.2
  - pylint>=2.14.5
  - pip>=22.2.2
  - pip:
     - PySide2>=5.14.2.3   #(ci version)
     - scikit-surgerycore>=0.1.7
     - scikit-surgeryutils>=1.2.0 #install scikit-surgeryvtk>=1.1.0
     - scikit-surgeryvtk==1.0.6 #so, downgraded
     - scikit-surgeryarucotracker>=0.1.1
     - opencv-python-headless==4.7.0.68
 
@thompson318
Copy link
Collaborator

There are two issues here. vtkmodules is only present in vtk > 9. Your build has installed vtk 8.1.2. So vtkmodules won't be present.
The second issue is that we removed QVTKRenderWindowInteractor.py from our code base at SciKit-Surgery/scikit-surgeryvtk#190, which would have been released at v1.1.0. This seemed like a good idea at the time, but I now realise this will cause problems for people on Ubuntu who can't use vtk 9.x.x.

@shrestha1
Copy link

@mxochicale I have faced the similar issue and solved it using vtk instead of vtkmodules since vtk==8.1.2 have vtk package instead of vtkmodule. In file vtk_overlay_window.py you can use from vtkmodules.qt.QVTKRenderWindowInteractor import
QVTKRenderWindowInteractor. Please try this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants