KitwareMedical / KitwareMedical/VTKPythonPackage

ImportError from wheel installation

未关闭
#38 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Python
星标
36
派生
16
PR 合并指标
30 天内没有已合并 PR

描述

Hello - thank you so much for the energy that you are investing in providing a wheel installation for VTK.

I have successfully installed the software, but am running into errors on import.

When installing from conda, I get the following error:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/srv/conda/envs/notebook/lib/python3.7/site-packages/vtkmodules/vtkRenderingOpenGL2.py in <module>
      4     # use relative import for installed modules
----> 5     from .vtkRenderingOpenGL2Python import *
      6 except ImportError:

ImportError: libGL.so.1: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-7c7f66f02cd3> in <module>
----> 1 import vtk

/srv/conda/envs/notebook/lib/python3.7/site-packages/vtk.py in <module>
     30     all_spec = importlib.util.find_spec('vtkmodules.all')
     31     all_m = importlib.util.module_from_spec(all_spec)
---> 32     all_spec.loader.exec_module(all_m)
     33 
     34     # import vtkmodules

/srv/conda/envs/notebook/lib/python3.7/site-packages/vtkmodules/all.py in <module>
     31 from .vtkIOXMLParser import *
     32 from .vtkDomainsChemistry import *
---> 33 from .vtkRenderingOpenGL2 import *
     34 from .vtkDomainsChemistryOpenGL2 import *
     35 from .vtkIOXML import *

/srv/conda/envs/notebook/lib/python3.7/site-packages/vtkmodules/vtkRenderingOpenGL2.py in <module>
      7     # during build and testing, the modules will be elsewhere,
      8     # e.g. in lib directory or Release/Debug config directories
----> 9     from vtkRenderingOpenGL2Python import *

ModuleNotFoundError: No module named 'vtkRenderingOpenGL2Python'

When installing with pip, I instead get the following error:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/srv/conda/envs/notebook/lib/python3.7/site-packages/vtk/vtkOpenGLKit.py in <module>
      4     # use relative import for installed modules
----> 5     from .vtkOpenGLKitPython import *
      6 except ImportError:

ImportError: libGL.so.1: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-7c7f66f02cd3> in <module>
----> 1 import vtk

/srv/conda/envs/notebook/lib/python3.7/site-packages/vtk/__init__.py in <module>
     10 from .vtkRenderingKit import *
     11 from .vtkIOKit import *
---> 12 from .vtkOpenGLKit import *
     13 from .vtkParallelKit import *
     14 from .vtkWrappingKit import *

/srv/conda/envs/notebook/lib/python3.7/site-packages/vtk/vtkOpenGLKit.py in <module>
      7     # during build and testing, the modules will be elsewhere,
      8     # e.g. in lib directory or Release/Debug config directories
----> 9     from vtkOpenGLKitPython import *

ModuleNotFoundError: No module named 'vtkOpenGLKitPython'

Note also that this is happening on a headless system (through a Jupyter notebook, running on a JupyterHub installed on EKS), which may be pertinent information.

Thanks!

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先,在所报告的 EKS 上的 headless JupyterHub 环境中,分别使用 conda 和 pip 安装来复现 import vtk。检查 vtkmodules/vtkRenderingOpenGL2.pyvtk/vtkOpenGLKit.py 中的导入路径;当 package 在所报告的 headless 设置中能够成功导入,且不会继续触发缺少 module 的错误时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
computer-graphics
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。