[vtkusers] python 2.7 and vtk
Shawn Waldon
shawn.waldon at kitware.com
Thu Jan 28 09:44:13 EST 2016
Hi Vikash,
You are right, vtkpython is a python interpreter that sets up the
environment so that the VTK modules are found. You can use the VTK modules
from another python interpreter as long as it is the same version of python
they were compiled against (2.7 in most cases, including the binaries on
the download page). You have to set the PYTHONPATH environment variable to
point to the vtk python modules and the
PATH/LD_LIBRARY_PATH/DYLD_LIBRARY_PATH environment variable to point to the
vtk C++ libraries that those python modules load. For example, on Linux
with vtk installed to /usr/local you would need:
export
LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/python2.7/site-packages/vtk:$LD_LIBRARY_
PATH
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
The paths are slightly different for each OS, so just ask the list if you
have trouble figuring it out and someone with your OS should be able to
help.
HTH,
Shawn
On Wed, Jan 27, 2016 at 7:15 PM, Vikash Gupta <Vikash.Gupta at loni.usc.edu>
wrote:
> Hi everyone,
> This might be a solved problem but I was not able to find a solution that
> worked for me. So, if someone can help me out it will be really great.
>
> I am trying to use vtkpython. I cannot install it using pip. So, I found
> the binary packages for python on the vtk website. The vtkPython executable
> seems like a python interpreter.
> Is there a way I could use the classical Python 2.7 interpreter and still
> use the vtk modules. The reason, I am more inclined to use my old
> interpreter because I can use pip for installing packages.
>
> Any help ??
>
> Thanks
> Vikash
>
> _______________________________________________
> 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 VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160128/6f72bdb5/attachment.html>
More information about the vtkusers
mailing list