[vtkusers] Problems Installing VTK-Python on OSX

David Gobbi david.gobbi at gmail.com
Fri Mar 4 13:53:04 EST 2016


If vtkpython works for you, then check to see where it is finding its files:

import vtk
print(vtk.__file__)
import vtkCommonCorePython
print(vtkCommonCorePython.__file__)

The "make install" might not copy the python modules into site-packages,
so you might have to copy them yourself.  My own experience with VTK's
"make install" is limited, I always use VTK from the build directory.

Cheers,
 - David


On Fri, Mar 4, 2016 at 10:42 AM, Ranveer Aggarwal <ranveeraggarwal at gmail.com
> wrote:

> I guess the `make install` didn't work as expected. Is there anything else
> I'm supposed to do after make install?
>
> On Fri, 4 Mar 2016 at 23:12 Ranveer Aggarwal <ranveeraggarwal at gmail.com>
> wrote:
>
>> When I use the vtkpython executable and do an `import vtk`, it works.
>>
>> On Fri, 4 Mar 2016 at 23:05 David Gobbi <david.gobbi at gmail.com> wrote:
>>
>>> You should also try the executable that VTK built (bin/vtkpython) to see
>>> if it gives a different result from running python3 directly.
>>>
>>> On Fri, Mar 4, 2016 at 10:31 AM, Ranveer Aggarwal <
>>> ranveeraggarwal at gmail.com> wrote:
>>>
>>>> Hi David,
>>>>
>>>> I looked all over CMakeCache.txt and didn't find any instance of
>>>> "python2".
>>>> Any other possible fix?
>>>>
>>>> If not, I'll try Bernard's solution.
>>>>
>>>> Thanks for your suggestions :)
>>>>
>>>> On Fri, 4 Mar 2016 at 19:05 David Gobbi <david.gobbi at gmail.com> wrote:
>>>>
>>>>> Hi Ranveer,
>>>>>
>>>>> The error "PyThreadState_Get: no current thread" almost always means
>>>>> that VTK was linked to the wrong version of Python.  I know you said that
>>>>> you checked this, but I recommend that you load CMakeCache.txt into a text
>>>>> editor and do a thorough search to make sure that "python2" does not appear
>>>>> anywhere.  My own OS X system builds VTK against Python 3.5.
>>>>>
>>>>>  - David
>>>>>
>>>>>
>>>>> On Fri, Mar 4, 2016 at 12:25 AM, Ranveer Aggarwal <
>>>>> ranveeraggarwal at gmail.com> wrote:
>>>>>
>>>>>> Hello all,
>>>>>>
>>>>>> I have been struggling with this problem for quite some time now.
>>>>>> Here's what I did.
>>>>>>
>>>>>> 1. Downloaded source tar.gz and untarred it.
>>>>>> 2. Went to the downloaded folder and made a build folder and ran
>>>>>> ccmake .. in it.
>>>>>> 3. Set Python Wrapping to on and set Python version as 3.5. Went to
>>>>>> advanced options and appropriately set all the Python 3.5 libraries.
>>>>>> 4. Generated the cmake and ran it.
>>>>>> 5. Ran make and then make install
>>>>>> 6. Added
>>>>>> "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/vtk/"
>>>>>> to PYTHONPATH.
>>>>>>
>>>>>> Now, when I run python3 and do an `import vtk`, I get
>>>>>>
>>>>>> Fatal Python error: PyThreadState_Get: no current thread
>>>>>> Segmentation fault: 11
>>>>>>
>>>>>> and Python crashes. Any idea why this could be happening? Any help
>>>>>> would be highly appreciated.
>>>>>> --
>>>>>>
>>>>>> Sincerely,
>>>>>> Ranveer Aggarwal
>>>>>> Indian Institute of Technology, Bombay
>>>>>> http://ranveeraggarwal.com
>>>>>>
>>>>> --
>>>>
>>>> Sincerely,
>>>> Ranveer Aggarwal
>>>> Indian Institute of Technology, Bombay
>>>> http://ranveeraggarwal.com
>>>>
>>>
>>> --
>>
>> Sincerely,
>> Ranveer Aggarwal
>> Indian Institute of Technology, Bombay
>> http://ranveeraggarwal.com
>>
> --
>
> Sincerely,
> Ranveer Aggarwal
> Indian Institute of Technology, Bombay
> http://ranveeraggarwal.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160304/685279d0/attachment.html>


More information about the vtkusers mailing list