[Paraview] Importing paraview.simple in external python environment

livia.barazzetti at istb.unibe.ch livia.barazzetti at istb.unibe.ch
Mon Jun 30 08:45:47 EDT 2014


Thank you for the response. 
I tried to change the PATH variable in windows but I had the same error.
 As a workaround,  I am changing my current directory (os.chdir('C:\\Program Files (x86)\\ParaView 4.0.1\\bin'))  before importing (successfully)  .
I don't know if maybe this depends on some configuration problem on my machine. 
Best regards
Livia


-----Original Message-----
From: Utkarsh Ayachit [mailto:utkarsh.ayachit at kitware.com] 
Sent: 28 June 2014 16:09
To: Barazzetti, Livia (ISTB)
Cc: ParaView
Subject: Re: [Paraview] Importing paraview.simple in external python environment

I believe you need to set you PATH environment variable to include the bin directory where all the dlls are.

On Wed, Jun 25, 2014 at 12:29 PM,  <livia.barazzetti at istb.unibe.ch> wrote:
> Hi,
>
> I am trying to use paraview python scripting from an external python 
> installation (enthought canopy).  I am trying this because I could not 
> import successfully scipy in pvpython (namely scipy.signal)  .
>
> I created a file called paraview.pth in 
> “C:\Users\lb\AppData\Local\Enthought\Canopy\User\Lib\site-packages”. 
> The content of the file is the following:
>
>
>
> C:\\Program Files (x86)\\ParaView 
> 4.0.1\\lib\\paraview-4.0\\site-packages
>
> C:\\Program Files (x86)\\ParaView 4.0.1\\lib\\paraview-4.0
>
> C:\\Program Files (x86)\\ParaView 4.0.1\\bin
>
> C:\\Program Files (x86)\\ParaView 4.0.1\\bin\\python27.zip
>
> C:\\Program Files (x86)\\ParaView 4.0.1\\bin\\DLLs
>
> C:\\Program Files (x86)\\ParaView 4.0.1\\bin\\lib
>
> C:\\Program Files (x86)\\ParaView 4.0.1\\bin\\lib\\plat-win
>
> C:\\Program Files (x86)\\ParaView 4.0.1\\bin\\lib\\lib-tk
>
> C:\\Program Files (x86)\\ParaView 4.0.1\\bin
>
> C:\\Program Files (x86)\\ParaView 4.0.1\\bin\\lib\\site-packages
>
>
>
> (I copied the paths from the command sys.path in pvpython)
>
>
>
> The only relevant difference I can see between the two installation is 
> that Canopy Python version is '2.7.6 | 64-bit | (default, Apr 11 2014, 
> 20:31:44) [MSC v.1500 64 bit (AMD64)]', while in  pvpython  the 
> version is '2.7.3 (default, Jun 16 2013, 20:21:46) [MSC v.1500 64 bit (AMD64)]'
>
>
>
> When  I try to run “import paraview.simple” in canopy I have the 
> following
> error:
>
> Error: Could not import vtkCommonComputationalGeometryPython
>
> ----------------------------------------------------------------------
> -----
>
> ImportError                               Traceback (most recent call last)
>
> <ipython-input-12-4308f7890145> in <module>()
>
> ----> 1 import paraview.simple
>
>
>
> C:\Program Files (x86)\ParaView
> 4.0.1\lib\paraview-4.0\site-packages\paraview\simple.py in <module>()
>
>      39 paraview.compatibility.major = 3
>
>      40 paraview.compatibility.minor = 5
>
> ---> 41 import servermanager
>
>      42
>
>      43
> #=====================================================================
> =========
>
>
>
> C:\Program Files (x86)\ParaView
> 4.0.1\lib\paraview-4.0\site-packages\paraview\servermanager.py in 
> <module>()
>
>      46 #
>
>      47
> #=====================================================================
> =========
>
> ---> 48 import paraview, re, os, os.path, new, sys, atexit, vtk
>
>      49
>
>      50 if not paraview.compatibility.major:
>
>
>
> C:\Program Files (x86)\ParaView
> 4.0.1\lib\paraview-4.0\site-packages\paraview\vtk\__init__.py in 
> <module>()
>
>       5 except ImportError:
>
>       6     paraview.print_error("Error: Could not import
> vtkCommonComputationalGeometryPython")
>
> ----> 7 from vtkCommonCorePython import *
>
>       8 from vtkCommonDataModelPython import *
>
>       9 from vtkCommonExecutionModelPython import *
>
>
>
> ImportError: DLL load failed: The specified module could not be found.
>
>
>
> I searched and vtkCommonComputationalGeometryPython.pyd is present in 
> “C:\Program Files (x86)\ParaView 4.0.1\lib\paraview-4.0”  and
> vtkCommonComputationalGeometryPython27D-pv4.0  in C:\Program Files 
> (x86)\ParaView 4.0.1\bin (then both folder are already in 
> paraview.pth). I checked with visual studio “dumpbin /headers” that 
> vtkCommonComputationalGeometryPython.pyd is 64 bit.
>
>
>
> I am using Paraview 4.0 (binaries downloaded from the website) on 
> Windows 7
> 64 bit.
>
> Any suggestion?
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>


More information about the ParaView mailing list