终端中的执行python脚本或Mac中的pvpython

问题描述 投票:0回答:1

我安装了ParaView 5.7并用它记录一个python脚本。在Windows 10中,我可以打开pvpython shell并执行代码,但在Mac中我找不到此pvpython shell。

我尝试在终端python my_script.py中执行脚本并得到错误

from paraview.simple import *
ImportError: No module named paraview.simple

我的sys.path

'/Library/Python/2.7/site-packages/pip-19.3.1-py2.7.egg', 
'/Users/jane/Desktop', 
'/home/jane/Code/Kitware/build/VTK/lib/python2.7/site-packages', 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', 
'/Library/Python/2.7/site-packages', 
'/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', 
'/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC'
]

我还应该添加到PYTHONPATH

python-2.7 paraview
1个回答
0
投票

在Mac上,pvpython安装在/Applications/ParaView-5.7.0.app/Contents/bin/pvpython

© www.soinside.com 2019 - 2024. All rights reserved.