<div dir="ltr">Thank you David and Michka.<div><br></div><div>I just figure it out.</div><div>Indeed you are right Michka, when I call 'python' from the terminal, it called the 2.7.5 from the system instead of the one VTK has been built with.</div>
<div><br></div><div>I went to python 2.7.3 directory and used ./python (instead of just 'python' command) and I got the 'No module named vtk', but then I added the path in PYTHONPATH and it worked.</div><div>
<br></div><div>Thank you very much for your help.</div><div><br></div><div>Also, is it possible to replace the default 'python' command with the 2.7.3 version, so I don't have to go in the directory all the time ?</div>
<div><br></div><div>Thank you.</div><div>-Laurent <br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 29, 2014 at 6:00 PM, Michka Popoff <span dir="ltr"><<a href="mailto:michkapopoff@gmail.com" target="_blank">michkapopoff@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 style="word-wrap:break-word"><div>Okay, I think the problem is the following.</div><div>If you type python in the terminal, OS X's python 2.7.5 is launched.</div>
<div>VTK for slicer was compiled against the shipped python 2.7.3 I suppose.</div><div><br></div><div>So you try to run from a 2.7.5 python a VTK library which was build against 2.7.3. That won't work (that's the error you get).</div>
<div>You can not mix the two.</div><div><br></div><br><div><div>Le 29 avr. 2014 à 23:53, Laurent Chauvin a écrit :</div><div><div class="h5"><br><blockquote type="cite"><div dir="ltr">Hi Michka,<div><br></div><div>Thank you for your answer.</div>
<div><br></div><div>I would prefer not to use a binary version of VTK, more a compiled version.</div><div><br></div><div>I, indeed, have multiple versions of python (2.7.5 installed with xcode, and 2.7.3 installed with Slicer).</div>

<div>However, I don't compile any code, and I don't use cmake. I just do something like 'python script.py'.</div><div><br></div><div>I tried in both terminal, and it worked in none of them, but it worked in Slicer python interpreter. I guess Slicer set proper environment variable, but I cannot figure it out which one I should set.</div>

<div><br></div><div>-Laurent</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 29, 2014 at 5:49 PM, Michka Popoff <span dir="ltr"><<a href="mailto:michkapopoff@gmail.com" target="_blank">michkapopoff@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 style="word-wrap:break-word"><div>Hi</div><div><br></div><div>if you need an easy install way on OS X 10.9, you may try installing vtk through homebrew.</div>

<div>There are formulas for VTK 5 and VTK 6 which contain the right options to install on OS X.</div><div>(Installation goes with "brew install vtk --with python")</div><div><br></div><div>You can also try my binaries, which are installable through homebrew (<a href="https://github.com/iMichka/homebrew-MacVTKITKPythonBottles" target="_blank">https://github.com/iMichka/homebrew-MacVTKITKPythonBottles</a>)</div>

<div>In this case you don't even have to compile VTK :)</div><div><br></div><div>The error you get is often due to a python library mismatch. Cmake is picking up the wrong libraries (the python lib does not correspond to the python executable).</div>

<div>Do you have mutliple pythons installed ?</div><div>You can also check the python paths in cmake (especially the path of the <span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:start;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:18px;color:rgb(221,17,68);text-transform:none;font-size:12px;white-space:pre-wrap;font-family:Consolas,'Liberation Mono',Courier,monospace;word-spacing:0px">PYTHON_LIBRARY</span>).</div>

<div><br></div><div>Michka</div><br><div><div>Le 29 avr. 2014 à 23:36, Laurent Chauvin a écrit :</div><br><blockquote type="cite"><div><div><div dir="ltr">Hello VTK Users,<div><br></div><div>I'm trying to run an example of VTK (the vtk Cube.py example) in python on Mac OSX 10.9.</div>

<div>I have VTK 5.10.1 and python 2.7.5.</div><div><br></div><div>I read this page:</div>
<div><a href="http://www.vtk.org/Wiki/VTK/Tutorials/PythonEnvironmentSetup" target="_blank">http://www.vtk.org/Wiki/VTK/Tutorials/PythonEnvironmentSetup</a><br></div><div><br></div><div>which solved the 'no module named vtk' error, but now, I got another error:</div>


<div><br></div><div>Fatal Python error: PyThreadState_Get: no current thread</div><div>Abort trap: 6</div><div><br></div><div>I heard the VTK 5.10 is not compatible with OSX 10.9, but it was a while ago (end of 2013).</div>


<div><br></div><div>The example is working when I use the python interpreter in Slicer, so my guess is this is an issue with the environment path, but I cannot figure it out.</div><div><br></div><div>Does anyone already ran vtk python examples in OSX 10.9 ?</div>


<div><br></div><div>Thank you very much.</div><div>-Laurent</div><div><div><div><br></div>-- <br><div dir="ltr"><div>Laurent Chauvin, MS</div><div>Surgical Navigation and Robotics Laboratory, Radiology Department</div><div>


Brigham And Women's Hospital, Harvard Medical School<br></div><div><a href="http://wiki.ncigt.org/index.php/User:Lchauvin" target="_blank">http://wiki.ncigt.org/index.php/User:Lchauvin</a></div></div>
</div></div></div></div></div>
_______________________________________________<br>Powered by <a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>

<br>Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>

</blockquote></div><br><div><br></div><p>The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.</p></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Laurent Chauvin, MS</div><div>Surgical Navigation and Robotics Laboratory, Radiology Department</div><div>Brigham And Women's Hospital, Harvard Medical School<br>

</div><div><a href="http://wiki.ncigt.org/index.php/User:Lchauvin" target="_blank">http://wiki.ncigt.org/index.php/User:Lchauvin</a></div></div>
</div>
</blockquote></div></div></div><br></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Laurent Chauvin, MS</div><div>Surgical Navigation and Robotics Laboratory, Radiology Department</div>
<div>Brigham And Women's Hospital, Harvard Medical School<br></div><div><a href="http://wiki.ncigt.org/index.php/User:Lchauvin" target="_blank">http://wiki.ncigt.org/index.php/User:Lchauvin</a></div></div>
</div>