问题描述
我成功地建造并安装VTK-5.4与源Python绑定。然而,当我尝试在Python导入VTK它提供了以下回溯误差
I successfully built and installed VTK-5.4 with Python bindings from source. Yet, when I try to import VTK in python it gives the following Traceback error
文件,1号线,在
文件/usr/local/lib/python2.6/dist-packages/VTK-5.4.2-py2.6.egg/vtk/init.py 线41,从常见的进口*
File "/usr/local/lib/python2.6/dist-packages/VTK-5.4.2-py2.6.egg/vtk/init.py", line 41, in from common import *
文件/usr/local/lib/python2.6/dist-packages/VTK-5.4.2-py2.6.egg/vtk/common.py 7号线,从libvtkCommonPython进口*
File "/usr/local/lib/python2.6/dist-packages/VTK-5.4.2-py2.6.egg/vtk/common.py", line 7, in from libvtkCommonPython import *
导入错误: libvtkCommonPythonD.so.5.4:无法打开共享对象文件:没有这样的文件或目录
ImportError: libvtkCommonPythonD.so.5.4: cannot open shared object file: No such file or directory
所以,我想知道我缺少的是什么?我曾尝试加入/usr/local/lib/vtk-5.4既PATH和PYTHONPATH环境变量,仍然得到同样的结果。任何提示或建议?
So I am wondering what I am missing? I have tried adding /usr/local/lib/vtk-5.4 to both PATH and PYTHONPATH environment variables and still get the same result. Any hints or suggestions?
请注意: libvtkCommonPythonD.so.5.4 的存在/usr/local/lib/vtk-5.4作为一个符号链接的 libvtkCommonPythonD.so.5.4.2 的
NOTE:libvtkCommonPythonD.so.5.4 exists in /usr/local/lib/vtk-5.4 as a symlink to libvtkCommonPythonD.so.5.4.2
推荐答案
测试若加入的/ usr / local / lib目录
您 $ LD_LIBRARY_PATH
帮助:
在一个shell:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
如果它的工作原理,使其永久化(加入的/ usr / local / lib目录
到 /etc/ld.so.conf中
)_(运行' ldconfig的-n的/ usr / local / lib目录
')
If it works, make it permanent by (adding /usr/local/lib
to /etc/ld.so.conf
) _ (running 'ldconfig -n /usr/local/lib
')
这篇关于我缺少的步骤在建筑/安装VTK-5.4与python2.6的绑定在Ubuntu 9.04?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!