VTK/Tutorials/PythonEnvironmentSetup: Difference between revisions
From KitwarePublic
Jump to navigationJump to search
(added some spaces which make the commands stand out) |
Daviddoria (talk | contribs) (Converted instructions to non-Paraview only) |
||
Line 1: | Line 1: | ||
In the following instructions, I have built VTK in '/home/doriad/bin/VTK' | |||
To run a vtk python script, simply type: | To run a vtk python script, simply type: | ||
Line 8: | Line 8: | ||
add the following line to ~/.bashrc | add the following line to ~/.bashrc | ||
export PYTHONPATH=$PYTHONPATH:/home/doriad/bin | export PYTHONPATH=$PYTHONPATH:/home/doriad/bin/VTK/Wrapping/Python/:/home/doriad/bin/VTK/Wrapping/Python/vtk | ||
Try to run the script again. If you get something like this: | Try to run the script again. If you get something like this: | ||
Line 14: | Line 14: | ||
Add the following to ~/.bashrc | Add the following to ~/.bashrc | ||
export LD_LIBRARY_PATH=/usr/local/lib:/home/doriad/bin/ | export LD_LIBRARY_PATH=/usr/local/lib:/home/doriad/bin/VTK/bin |
Revision as of 18:13, 19 October 2010
In the following instructions, I have built VTK in '/home/doriad/bin/VTK'
To run a vtk python script, simply type:
python script.py
If you receive this error:
ImportError: No module named vtk
add the following line to ~/.bashrc
export PYTHONPATH=$PYTHONPATH:/home/doriad/bin/VTK/Wrapping/Python/:/home/doriad/bin/VTK/Wrapping/Python/vtk
Try to run the script again. If you get something like this:
ImportError: libvtkCommonPythonD.so.pv3.7: cannot open shared object file: No such file or directory
Add the following to ~/.bashrc
export LD_LIBRARY_PATH=/usr/local/lib:/home/doriad/bin/VTK/bin