2017-09-25 162 views
0

,當我通過蟒蛇VTK與Python 3.6,蟒蛇4.4

[email protected]:~# conda install -c clinicalgraphics vtk=7.1.0 
Fetching package metadata ........... 
Solving package specifications: . 

# All requested packages already installed. 
# packages in environment at /home/user/anaconda3: 
# 
vtk      7.1.0     py36_3 clinicalgraphics 
[email protected]~# python 
Python 3.6.1 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:09:58) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import vtk 
Traceback (most recent call last): 
    File "/home/user/anaconda3/lib/python3.6/site-packages/vtk/vtkCommonCore.py", line 5, in <module> 
    from .vtkCommonCorePython import * 
ImportError: /home/user/anaconda3/lib/python3.6/site-packages/vtk/../../../libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /home/user/anaconda3/lib/python3.6/site-packages/vtk/../../../libvtkCommonCorePython36D-7.1.so.1) 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
    File "/home/user/anaconda3/lib/python3.6/site-packages/vtk/__init__.py", line 41, in <module> 
    from .vtkCommonCore import * 
    File "/home/user/anaconda3/lib/python3.6/site-packages/vtk/vtkCommonCore.py", line 9, in <module> 
    from vtkCommonCorePython import * 
ModuleNotFoundError: No module named 'vtkCommonCorePython' 

我使用Install vtk with python 3.6No module ImportError提出的解決方案試圖VTK與Python運行我有以下錯誤,他們似乎並沒有工作。令人驚訝的是,我沒有在Windows發行版中遇到這個問題。歡迎任何其他建議。我真的試圖避免從Python3降級到Python2或使用單獨的conda環境只爲vtk ..但如果最終這樣做......我想我必須做到這一點。我嘗試鏈接我自己構建的vtk 8的庫......這似乎並不工作

回答

0

所以我最終創建了一個基於menpo vtk = 7 python = 3的新環境,使用以下命令

[email protected]:~# conda create --name VTKpythonENV python=3 
    ....... 
[email protected]:~# conda install -n VTKpythonENV -c menpo vtk=7 python=3 
.......... 
[email protected]:~# source activate VTKpythonENV 
(VTKpythonENV) [email protected]:~# python 
Python 3.6.2 |Continuum Analytics, Inc.| (default, Jul 20 2017, 13:51:32) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import vtk 

這對我的作品,但臨牀使用圖形vtk的其他建議也歡迎