<div dir="ltr">This is what I thought.<div><br></div><div>I think I will create an alias like 'python2.7.3' to avoid confusing the system.</div><div><br></div><div><div>Thank you.</div></div><div>-Laurent</div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 29, 2014 at 6:16 PM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The easiest way is to add an alias to your .bash_profile file,<br>
which is in your home directory:<br>
<br>
alias python=/path/to/python<br>
<span class="HOEnZb"><font color="#888888"><br>
David<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
On Tue, Apr 29, 2014 at 4:09 PM, Laurent Chauvin<br>
<<a href="mailto:lchauvin@bwh.harvard.edu">lchauvin@bwh.harvard.edu</a>> wrote:<br>
> Thank you David and Michka.<br>
><br>
> I just figure it out.<br>
> Indeed you are right Michka, when I call 'python' from the terminal, it<br>
> called the 2.7.5 from the system instead of the one VTK has been built with.<br>
><br>
> I went to python 2.7.3 directory and used ./python (instead of just 'python'<br>
> command) and I got the 'No module named vtk', but then I added the path in<br>
> PYTHONPATH and it worked.<br>
><br>
> Thank you very much for your help.<br>
><br>
> Also, is it possible to replace the default 'python' command with the 2.7.3<br>
> version, so I don't have to go in the directory all the time ?<br>
><br>
> Thank you.<br>
> -Laurent<br>
><br>
><br>
> On Tue, Apr 29, 2014 at 6:00 PM, Michka Popoff <<a href="mailto:michkapopoff@gmail.com">michkapopoff@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Okay, I think the problem is the following.<br>
>> If you type python in the terminal, OS X's python 2.7.5 is launched.<br>
>> VTK for slicer was compiled against the shipped python 2.7.3 I suppose.<br>
>><br>
>> So you try to run from a 2.7.5 python a VTK library which was build<br>
>> against 2.7.3. That won't work (that's the error you get).<br>
>> You can not mix the two.<br>
>><br>
>><br>
>> Le 29 avr. 2014 à 23:53, Laurent Chauvin a écrit :<br>
>><br>
>> Hi Michka,<br>
>><br>
>> Thank you for your answer.<br>
>><br>
>> I would prefer not to use a binary version of VTK, more a compiled<br>
>> version.<br>
>><br>
>> I, indeed, have multiple versions of python (2.7.5 installed with xcode,<br>
>> and 2.7.3 installed with Slicer).<br>
>> However, I don't compile any code, and I don't use cmake. I just do<br>
>> something like 'python script.py'.<br>
>><br>
>> I tried in both terminal, and it worked in none of them, but it worked in<br>
>> Slicer python interpreter. I guess Slicer set proper environment variable,<br>
>> but I cannot figure it out which one I should set.<br>
>><br>
>> -Laurent<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> On Tue, Apr 29, 2014 at 5:49 PM, Michka Popoff <<a href="mailto:michkapopoff@gmail.com">michkapopoff@gmail.com</a>><br>
>> wrote:<br>
>>><br>
>>> Hi<br>
>>><br>
>>> if you need an easy install way on OS X 10.9, you may try installing vtk<br>
>>> through homebrew.<br>
>>> There are formulas for VTK 5 and VTK 6 which contain the right options to<br>
>>> install on OS X.<br>
>>> (Installation goes with "brew install vtk --with python")<br>
>>><br>
>>> You can also try my binaries, which are installable through homebrew<br>
>>> (<a href="https://github.com/iMichka/homebrew-MacVTKITKPythonBottles" target="_blank">https://github.com/iMichka/homebrew-MacVTKITKPythonBottles</a>)<br>
>>> In this case you don't even have to compile VTK :)<br>
>>><br>
>>> The error you get is often due to a python library mismatch. Cmake is<br>
>>> picking up the wrong libraries (the python lib does not correspond to the<br>
>>> python executable).<br>
>>> Do you have mutliple pythons installed ?<br>
>>> You can also check the python paths in cmake (especially the path of the<br>
>>> PYTHON_LIBRARY).<br>
>>><br>
>>> Michka<br>
>>><br>
>>> Le 29 avr. 2014 à 23:36, Laurent Chauvin a écrit :<br>
>>><br>
>>> Hello VTK Users,<br>
>>><br>
>>> I'm trying to run an example of VTK (the vtk Cube.py example) in python<br>
>>> on Mac OSX 10.9.<br>
>>> I have VTK 5.10.1 and python 2.7.5.<br>
>>><br>
>>> I read this page:<br>
>>> <a href="http://www.vtk.org/Wiki/VTK/Tutorials/PythonEnvironmentSetup" target="_blank">http://www.vtk.org/Wiki/VTK/Tutorials/PythonEnvironmentSetup</a><br>
>>><br>
>>> which solved the 'no module named vtk' error, but now, I got another<br>
>>> error:<br>
>>><br>
>>> Fatal Python error: PyThreadState_Get: no current thread<br>
>>> Abort trap: 6<br>
>>><br>
>>> I heard the VTK 5.10 is not compatible with OSX 10.9, but it was a while<br>
>>> ago (end of 2013).<br>
>>><br>
>>> The example is working when I use the python interpreter in Slicer, so my<br>
>>> guess is this is an issue with the environment path, but I cannot figure it<br>
>>> out.<br>
>>><br>
>>> Does anyone already ran vtk python examples in OSX 10.9 ?<br>
>>><br>
>>> Thank you very much.<br>
>>> -Laurent<br>
>>><br>
>>> --<br>
>>> Laurent Chauvin, MS<br>
>>> Surgical Navigation and Robotics Laboratory, Radiology Department<br>
>>> Brigham And Women's Hospital, Harvard Medical School<br>
>>> <a href="http://wiki.ncigt.org/index.php/User:Lchauvin" target="_blank">http://wiki.ncigt.org/index.php/User:Lchauvin</a><br>
>>><br>
</div></div><div class="HOEnZb"><div class="h5">>>> The information in this e-mail is intended only for the person to whom it<br>
>>> is<br>
>>> addressed. If you believe this e-mail was sent to you in error and the<br>
>>> e-mail<br>
>>> contains patient information, please contact the Partners Compliance<br>
>>> 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<br>
>>> error<br>
>>> but does not contain patient information, please contact the sender and<br>
>>> properly<br>
>>> dispose of the e-mail.<br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>> Laurent Chauvin, MS<br>
>> Surgical Navigation and Robotics Laboratory, Radiology Department<br>
>> Brigham And Women's Hospital, Harvard Medical School<br>
>> <a href="http://wiki.ncigt.org/index.php/User:Lchauvin" target="_blank">http://wiki.ncigt.org/index.php/User:Lchauvin</a><br>
>><br>
>><br>
><br>
><br>
><br>
> --<br>
> Laurent Chauvin, MS<br>
> Surgical Navigation and Robotics Laboratory, Radiology Department<br>
> Brigham And Women's Hospital, Harvard Medical School<br>
> <a href="http://wiki.ncigt.org/index.php/User:Lchauvin" target="_blank">http://wiki.ncigt.org/index.php/User:Lchauvin</a><br>
</div></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>