<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)">To answer myself and in case anyone needs this, I fixed the problem by appending the bin directory to the PYTHONPATH variable:</div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif">$ export PYTHONPATH=${PYTHONPATH}:/Applications/vtkpython/bin/</font><br></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif">It is important to run the executable with absolute path,</font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif">$ /Applications/vtkpython/bin/vtkpython</font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif">since some libraries linked by this executable are relative to the actual installation directory. This info obtained from otool:</font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif">$ otool -L /Applications/vtkpython/bin/vtkpython</font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif"><div class="gmail_default">/Applications/vtkpython/bin/vtkpython:</div><div class="gmail_default"><span style="white-space:pre-wrap">     </span>@executable_path/../lib/libvtkWrappingPython27Core-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0)</div><div class="gmail_default"><span style="white-space:pre-wrap">      </span>/usr/lib/libutil.dylib (compatibility version 1.0.0, current version 1.0.0)</div><div class="gmail_default"><span style="white-space:pre-wrap">      </span>@executable_path/../lib/libvtkCommonCore-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0)</div><div class="gmail_default"><span style="white-space:pre-wrap">        </span>/System/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.1)</div><div class="gmail_default"><span style="white-space:pre-wrap">     </span>@executable_path/../lib/libvtksys-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0)</div><div class="gmail_default"><span style="white-space:pre-wrap">       </span>/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)</div><div class="gmail_default"><span style="white-space:pre-wrap"> </span>/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)</div><div class="gmail_default">Best regards</div></font></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jun 25, 2016 at 5:15 PM, William Oquendo <span dir="ltr"><<a href="mailto:woquendo@gmail.com" target="_blank">woquendo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)"><div class="gmail_default">Dear all,</div><div class="gmail_default">I am in Mac Os X Yosemite. Trying to fix "import vtk" errors, I downloaded and moved vtkpython onto /Applications. If I go to taht directory and run vtkpython and try to import vtk, everything works:</div><div class="gmail_default">$ cd /Applications/vtkpython/bin </div><div class="gmail_default">$ ./vtkpython </div><div class="gmail_default"><div class="gmail_default">vtk version 7.0.0</div><div class="gmail_default">Python 2.7.10 (default, Jul 14 2015, 19:46:27)</div><div class="gmail_default">[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin</div><div class="gmail_default">Type "help", "copyright", "credits" or "license" for more information.</div><div class="gmail_default">>>> import vtk</div><div class="gmail_default">No error.</div></div><div class="gmail_default">But, if run vtkpython from another directory , I get the interpreter but it cannot import vtk:<br></div><div class="gmail_default">$ /Applications/vtkpython/bin/vtkpython</div><div class="gmail_default"><div class="gmail_default">vtk version 7.0.0</div><div class="gmail_default">Python 2.7.10 (default, Jul 14 2015, 19:46:27)</div><div class="gmail_default">[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin</div><div class="gmail_default">Type "help", "copyright", "credits" or "license" for more information.</div><div class="gmail_default">>>> import vtk</div><div class="gmail_default">Traceback (most recent call last):<br></div><div class="gmail_default"><div class="gmail_default">  File "<stdin>", line 1, in <module></div><div class="gmail_default">ImportError: No module named vtk</div></div></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)">​BTW, the following variables are set:</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)">$ echo $PYTHONPATH</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)">:/Applications/vtkpython/lib/:/Applications/vtkpython/bin/vtk/</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)">$ echo $LD_LIBRARY_PATH</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)">:/Applications/vtkpython/lib/:/Applications/vtkpython/bin/vtk/</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)">Could you please help to fix this and be able to run vtkpython from outside the installation directory? </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)">Thanks in advance​</div><span class="HOEnZb"><font color="#888888"><div><br></div></font></span></div></div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div data-smartmail="gmail_signature"><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">Best regards / Cordialmente,</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif"><br></span><div><span style="font-family:arial,helvetica,sans-serif">William-Fernando Oquendo</span><div><div style="font-family:arial,helvetica,sans-serif">--------------------------</div><div style="font-family:arial,helvetica,sans-serif">Este correo puede carecer de tildes o eñes debido al teclado. </div><div style="font-family:arial,helvetica,sans-serif"><br></div></div></div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">Best regards / Cordialmente,</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif"><br></span><div><span style="font-family:arial,helvetica,sans-serif">William-Fernando Oquendo</span><div><div style="font-family:arial,helvetica,sans-serif">--------------------------</div><div style="font-family:arial,helvetica,sans-serif">Este correo puede carecer de tildes o eñes debido al teclado. </div><div style="font-family:arial,helvetica,sans-serif"><br></div></div></div></div>
</div>