这是一个与之相关的问题 Trace files/modules loaded when launching python
我在Ubuntu 14.04 LTS下使用Paraview 4.0.1,在加载python提示符时出现不同的行为:
在命令行中,所有内容都能正常运行"。
在GUI(" python shell")中,from paraview.simple import *
失败,无论是自动(启动时)还是显式导入。
下面我添加(TL; DR)上面的方法1和2获得的输出的比较,两个级别的详细程度。
1.1。在命令提示符下:
$ pvpython
Python 2.7.6 (default, Oct 26 2016, 20:33:43)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from paraview.simple import *
paraview version 4.0.1
>>>
1.2。在GUI中的python shell:
Python 2.7.6 (default, Oct 26 2016, 20:33:43)
[GCC 4.8.4] on linux2
from paraview.simple import *
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/paraview/simple.py", line 41, in <module>
import servermanager
File "/usr/lib/python2.7/dist-packages/paraview/servermanager.py", line 3157, in <module>
__initialize()
File "/usr/lib/python2.7/dist-packages/paraview/servermanager.py", line 3148, in __initialize
c = Connection(iter.GetCurrentSessionId(), iter.GetCurrentSession())
File "/usr/lib/python2.7/dist-packages/paraview/servermanager.py", line 1935, in __init__
_createModules(self.Modules)
File "/usr/lib/python2.7/dist-packages/paraview/servermanager.py", line 2567, in _createModules
m.filters = createModule('filters')
File "/usr/lib/python2.7/dist-packages/paraview/servermanager.py", line 2629, in createModule
if (prop.GetInformationOnly() and propName != "TimestepValues" ) \
AttributeError: 'NoneType' object has no attribute 'GetInformationOnly'
>>> from paraview.simple import *
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/paraview/servermanager.py", line 2190, in find_module
if vtkPVPythonModule.HasModule(fullname):
AttributeError: 'NoneType' object has no attribute 'HasModule'
>>>