首页 > 解决方案 > 如何克服无法加载 vtkClientServerPython?

问题描述

我必须在 python 中运行一些 paraview 跟踪文件来自动化这个过程。为此,我尝试将 paraview 导入为

from paraview.simple import *

但是,它向我显示了一个错误

“加载 vtkClientServerPython 失败:没有名为 vtkmodules.vtkCommonCorePython 的模块”
我之前从 python 运行过 paraview,它工作正常。但是现在,这几天给我带来了一个问题。如何克服这一点?下面是代码中包含的 paraview 的完整 sys 路径。
import numpy as np
import sys, os
ParaViewBuildPath = "/home/ParaView-5.7.0-MPI-Linux-Python3.7-64bit/"
sys.path.append(ParaViewBuildPath + "lib/") 
sys.path.append(ParaViewBuildPath + "lib/python3.7/site-packages")
sys.path.append(ParaViewBuildPath + "lib/python3.7/site-packages/vtkmodules")

from paraview.simple import *

标签: pythonimportvtkparaviewopenfoam

解决方案


推荐阅读