VTK/Tutorials/PythonEnvironmentSetup: Difference between revisions
From KitwarePublic
Jump to navigationJump to search
Daviddoria (talk | contribs) |
Chuck.atkins (talk | contribs) (Update paths to be correct) |
||
(3 intermediate revisions by 2 users not shown) | |||
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: | ||
python script.py | python script.py | ||
If you receive this error: | If you receive this error: | ||
ImportError: No module named vtk | ImportError: No module named vtk | ||
add the following line to ~/.bashrc | add the following line to ~/.bashrc | ||
export PYTHONPATH= | export PYTHONPATH=/home/doriad/bin/VTK/lib:/home/doriad/bin/VTK/lib/site-packages:/home/doriad/bin/VTK/Wrapping/Python:$PYTHONPATH | ||
Try to run the script again. If you get something like this: | 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 | ImportError: libvtkCommonPythonD.so.pv3.7: cannot open shared object file: No such file or directory | ||
Add the following to ~/.bashrc | Add the following to ~/.bashrc | ||
export LD_LIBRARY_PATH= | export LD_LIBRARY_PATH=/home/doriad/bin/VTK/lib:$LD_LIBRARY_PATH |
Latest revision as of 19:01, 18 February 2016
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=/home/doriad/bin/VTK/lib:/home/doriad/bin/VTK/lib/site-packages:/home/doriad/bin/VTK/Wrapping/Python:$PYTHONPATH
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=/home/doriad/bin/VTK/lib:$LD_LIBRARY_PATH