VTK install

G

Gib

As part of the MayaVi install, I need to install VTK. Follwoing the
Enthought instructions, I went here:
http://cpbotha.net/2009/08/13/python-2-6-enabled-vtk-5-4-windows-binaries/
and installed vtk-5.4. I modified the PATH and also created an
environment variable PYTHONPATH as directed, setting it to be C:
\Program Files\VTK\bin; C:\Program Files\VTK\lib\site-packages;
According to Botha's instructions, I should now be able to do 'import
vtk', but this doesn't work: no module named vtk.

Since VTK appears to be installed, I'm guessing that either the path
setting is wrong, or python is not using PYTHONPATH. How can I check
that PYTHONPATH is being used?
 
F

Francesco Bochicchio

As part of the MayaVi install, I need to install VTK.  
....

Since VTK appears to be installed, I'm guessing that either the path
setting is wrong, or python is not using PYTHONPATH.  How can I check
that PYTHONPATH is being used?

The paths in PYTHONPATH should show un sys.path python variable. So
just do from a
python prompt "import sys; sys.path" and check if the VTK directories
are listed.

You colòud aslo tentatively append your path to sys.path and then try
again import vtk
to see if it is a path problem or something else ...

Ciao
 
G

Gib

The paths in PYTHONPATH should show un sys.path python variable. So
just do from a
python prompt "import sys; sys.path" and check if the VTK directories
are listed.

You colòud aslo tentatively append your path to sys.path and then try
again import vtk
to see if it is a path problem or something else ...

Ciao

Interesting. sys.path includes this path:
'C:\\Documents and Settings\\mbog002.EC\\ C:\\Program Files\\VTK\\lib\
\site-packages'
The first part is what I set the environment variable HOME to (as per
Enthought instructions), the second part is the VTK path. Apparently
the specified VTK path is being made relative to HOME - clearly
inconsistent with the installation instructions.

I solved the problem by editing PYTHONPATH in the registry.
Definitely a trap for Windows users.
 
G

Gabriel Genellina

Interesting. sys.path includes this path:
'C:\\Documents and Settings\\mbog002.EC\\ C:\\Program Files\\VTK\\lib\
\site-packages'
The first part is what I set the environment variable HOME to (as per
Enthought instructions), the second part is the VTK path. Apparently
the specified VTK path is being made relative to HOME - clearly
inconsistent with the installation instructions.

Your VTK path starts with a space, and that confuses the path
manipulations.
I solved the problem by editing PYTHONPATH in the registry.
Definitely a trap for Windows users.

If you set the VTK path to an absolute path, this should not happen.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top