0

I've tried following the directions here without success. Here are some of my environment variables:

Path: C:\Python34\;C:\Python34\Scripts;...;C:\Program Files (x86)\ParaView 4.3.1\lib\paraview-4.3\site-packages;C:\Program Files (x86)\ParaView 4.3.1\lib\paraview-4.3\site-packages\vtk

PYTHONPATH: C:\Program Files (x86)\ParaView 4.3.1\lib\paraview-4.3\site-packages;C:\Program Files (x86)\ParaView 4.3.1\lib\paraview-4.3\site-packages\vtk;C:\Program Files (x86)\ParaView 4.3.1\lib\paraview-4.3

If I'm in Liclipse and I type c = Cone() it gets underlined in red and I get an "Undefined Variable" message, whether I have from paraview.simple import * at the top or not. I can, however, type things like paraview.simple.GetActiveSource() and paraview.simple.demo1() without seeing this problem if I've imported paraview.simple. But then, if I try to run the code from a command prompt, I get a message that says:

File "C:\Program Files (x86)\ParaView 4.3.1\lib\paraview-4.3\site-packages\paraview\vtk__init__.py", line 7, in module

from vtkCommonCorePython import *

ImportError: DLL load failed: The specified module could not be found.

If I write from paraview.simple import * in an IDLE 2.7.8 window, I get the same error. If I use my IDLE 3.4.3 window, I get a syntax error.

The only success that I've had is with writing some code that appears to have errors, and then either loading it as a macro within ParaView or pressing the "Run Script" button from ParaView's Python shell.


Edit: I just tried reinstalling Python 2, thinking that maybe ParaView only works with Python 2? This changed my environment variables a little:

Path: C:\Python27\;C:\Python27\Scripts;C:\Python34\;C:\Python34\Scripts;...;C:\Program Files (x86)\ParaView 4.3.1\lib\paraview-4.3\site-packages;C:\Program Files (x86)\ParaView 4.3.1\lib\paraview-4.3\site-packages\vtk

Now, the error has changed to this:

File "C:\Program Files (x86)\ParaView 4.3.1\lib\paraview-4.3\site-packages\paraview\vtk__init__.py", line 7, in module

from vtkCommonCorePython import *

ImportError: DLL load failed: %1 is not a valid Win32 application.


Edit: Now that the problem has been resolved, I thought I should share my path variables.

Path: C:\Python27\;C:\Python27\Scripts;...;C:\Program Files (x86)\ParaView 4.3.1\bin

PYTHONPATH: C:\Program Files (x86)\ParaView 4.3.1\lib\paraview-4.3\site-packages;C:\Program Files (x86)\ParaView 4.3.1\lib\paraview-4.3\site-packages\vtk

GregNash
  • 1,316
  • 1
  • 16
  • 25
  • I have reported the same issue [here](https://discourse.paraview.org/t/render-causes-a-non-responsive-visualization-toolkit-win32opengl-on-windows/538/2?u=foadsf) – Foad S. Farimani Sep 07 '18 at 00:18

1 Answers1

1

Yes, you need to work with python 2 (64bit). Make sure you are adding to the path the folder with the *.pyd and *.dll (I think it's a folder called bin)

lib
  • 2,918
  • 3
  • 27
  • 53
  • The folder with vtkCommonCorePython.pyd is in both my "Path" and my "PYTHONPATH" environment variables. There is no vtkCommonCorePython.dll file, but there is a vtkCommonCorePython27D-pv4.3.dll file in the bin directory. I've added that bin folder to both my "Path" and "PYTHONPATH" environment variables, but the error message is still the same. – GregNash Aug 10 '15 at 14:45
  • Maybe I have something in one of my paths that shouldn't be there? Or maybe I have things in the wrong order? – GregNash Aug 10 '15 at 15:03
  • The last error seems to be http://stackoverflow.com/a/4676478/1136458 . If you are curious to understand exactly where python is looking for loading the dll, use process monitor https://technet.microsoft.com/en-us/library/bb896645.aspx – lib Aug 10 '15 at 15:06
  • I didn't realize that I was using the 32-bit version of Python 2. That fixed the problem. – GregNash Aug 10 '15 at 15:41