Python Bindings on OSX?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Python Bindings on OSX?

sensei_sen
Hi! I am trying to build VTK with python bindings (I need it for MayaVi), without any success so far.

My VTK configuration has turned on VTK_WRAP_PYTHON and BUILD_SHARED_LIBS, while the CMAKE_OSX_ARCHITECTURES is set to i386.

The first problem is met building it, but searching on the net I find that issuing "chmod 600 Utilities/vtktiff/tif_fax3sm.c" does the trick. And it did.

The second problem I found was in the python installation process, since it uses /usr/local also for python:

<shell>
Checking .pth file support in /usr/local/lib/python2.6/site-packages/
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 2] No such file or directory: '/usr/local/lib/python2.6/site-packages/test-easy-install-57720.pth'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /usr/local/lib/python2.6/site-packages/

This directory does not currently exist.  Please create it and try again, or
choose a different installation directory (using the -d or --install-dir
option).
</shell>

However, running "/usr/bin/python2.6 setup.py install" under VTK/Wrapping/Python (without the --prefix switch), worked for me. Or at least I thought so:

<shell>
$ cd Wrapping/Python && /usr/bin/python2.6 setup.py installrunning install
running bdist_egg
running egg_info
creating VTK.egg-info
...
creating 'dist/VTK-5.4.2-py2.6.egg' and adding 'build/bdist.macosx-10.6-universal/egg' to it
removing 'build/bdist.macosx-10.6-universal/egg' (and everything under it)
Processing VTK-5.4.2-py2.6.egg
creating /Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg
Extracting VTK-5.4.2-py2.6.egg to /Library/Python/2.6/site-packages
Adding VTK 5.4.2 to easy-install.pth file

Installed /Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg
Processing dependencies for VTK==5.4.2
Finished processing dependencies for VTK==5.4.2
</shell>

The problem is with shared libraries. Trying to start the MayaVi VTK test script, or even trying to import vtk from a python shell, I get the following problem:

<shell>
$ python test_vtk.py
Testing if Tkinter is available...
OK - you have Tkinter
TclVersion = 8.5, TkVersion = 8.5
Traceback (most recent call last):
  File "test_vtk.py", line 210, in <module>
    test_value_error()
  File "test_vtk.py", line 178, in test_value_error
    import vtk
  File "/Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/__init__.py", line 41, in <module>
    from common import *
  File "/Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/common.py", line 7, in <module>
    from libvtkCommonPython import *
ImportError: dlopen(/Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/libvtkCommonPython.so, 10): no suitable image found.  Did find:
        /Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/libvtkCommonPython.so: mach-o, but wrong architecture
</shell>

This puzzles me for two reasons. First, the suffix is .so instead of the standard .dylib (I created there some symlinks with the dylib suffix, just in case). The second is simple: the architecture seems to be ok to me, although the file type might not be so:

<shell>
$ file /Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/libvtkCommonPython.so
/Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/libvtkCommonPython.so: Mach-O bundle i386
</shell>

Why do I get this 'wrong architecture' error? Usually, shared libs have as file types "Mach-O universal binary", and not "bundle"...

Can you walk me out of this?

Thanks & cheers!









_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Python Bindings on OSX?

David Gobbi
I can't comment on the installation issues because I always use VTK
in-situ instead of doing an install.  For the other questions,

The ".so" suffix denotes a loadable python module, and it is the
correct suffix even though it is a shared object just like a .dylib.
You will probably note that there is a libvtkCommonPython.so and a
libvtkCommonPythonD.dylib.  The former contains the module
initialization code, and the latter contains most of the python
wrapper code.  The .so file must be somewhere in the PYTHONPATH and
the .dylib must be somewhere in the DYLD_LIBRARY_PATH.

The best architecture to use on 0S X 10.6 is x86_64, because that is
the architecture that the python 2.6 executable uses when you run it
from the command line.  The i386 architecture should only be used when
building with python 2.5 for when you want to keep binary
compatibility with OS X 10.5.

   David



On Wed, Jul 14, 2010 at 9:20 AM, Sensei <[hidden email]> wrote:

> Hi! I am trying to build VTK with python bindings (I need it for MayaVi), without any success so far.
>
> My VTK configuration has turned on VTK_WRAP_PYTHON and BUILD_SHARED_LIBS, while the CMAKE_OSX_ARCHITECTURES is set to i386.
>
> The first problem is met building it, but searching on the net I find that issuing "chmod 600 Utilities/vtktiff/tif_fax3sm.c" does the trick. And it did.
>
> The second problem I found was in the python installation process, since it uses /usr/local also for python:
>
> <shell>
> Checking .pth file support in /usr/local/lib/python2.6/site-packages/
> error: can't create or remove files in install directory
>
> The following error occurred while trying to add or remove files in the
> installation directory:
>
>    [Errno 2] No such file or directory: '/usr/local/lib/python2.6/site-packages/test-easy-install-57720.pth'
>
> The installation directory you specified (via --install-dir, --prefix, or
> the distutils default setting) was:
>
>    /usr/local/lib/python2.6/site-packages/
>
> This directory does not currently exist.  Please create it and try again, or
> choose a different installation directory (using the -d or --install-dir
> option).
> </shell>
>
> However, running "/usr/bin/python2.6 setup.py install" under VTK/Wrapping/Python (without the --prefix switch), worked for me. Or at least I thought so:
>
> <shell>
> $ cd Wrapping/Python && /usr/bin/python2.6 setup.py installrunning install
> running bdist_egg
> running egg_info
> creating VTK.egg-info
> ...
> creating 'dist/VTK-5.4.2-py2.6.egg' and adding 'build/bdist.macosx-10.6-universal/egg' to it
> removing 'build/bdist.macosx-10.6-universal/egg' (and everything under it)
> Processing VTK-5.4.2-py2.6.egg
> creating /Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg
> Extracting VTK-5.4.2-py2.6.egg to /Library/Python/2.6/site-packages
> Adding VTK 5.4.2 to easy-install.pth file
>
> Installed /Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg
> Processing dependencies for VTK==5.4.2
> Finished processing dependencies for VTK==5.4.2
> </shell>
>
> The problem is with shared libraries. Trying to start the MayaVi VTK test script, or even trying to import vtk from a python shell, I get the following problem:
>
> <shell>
> $ python test_vtk.py
> Testing if Tkinter is available...
> OK - you have Tkinter
> TclVersion = 8.5, TkVersion = 8.5
> Traceback (most recent call last):
>  File "test_vtk.py", line 210, in <module>
>    test_value_error()
>  File "test_vtk.py", line 178, in test_value_error
>    import vtk
>  File "/Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/__init__.py", line 41, in <module>
>    from common import *
>  File "/Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/common.py", line 7, in <module>
>    from libvtkCommonPython import *
> ImportError: dlopen(/Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/libvtkCommonPython.so, 10): no suitable image found.  Did find:
>        /Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/libvtkCommonPython.so: mach-o, but wrong architecture
> </shell>
>
> This puzzles me for two reasons. First, the suffix is .so instead of the standard .dylib (I created there some symlinks with the dylib suffix, just in case). The second is simple: the architecture seems to be ok to me, although the file type might not be so:
>
> <shell>
> $ file /Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/libvtkCommonPython.so
> /Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/libvtkCommonPython.so: Mach-O bundle i386
> </shell>
>
> Why do I get this 'wrong architecture' error? Usually, shared libs have as file types "Mach-O universal binary", and not "bundle"...
>
> Can you walk me out of this?
>
> Thanks & cheers!
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Python Bindings on OSX?

Eric E. Monson
In reply to this post by sensei_sen
Hello,

Which version of OS X are you using? Are you using the standard system Python, or is it one you've built yourself?

The .so extension for the libraries in the VTK egg are normal (but you'll have to have someone else explain why it's that and not .dylib). You shouldn't have to create any other symlinks.

It was a little unclear to me, when you are running the setup.py script, are you doing that from the VTK/Wrapping/Python source directory, or your build/Wrapping/Python directory? Mine installs and imports fine if I run "sudo python setup.py install" from the latter, as long as I've built VTK with VTK_USE_RPATH: ON.

(I'm building VTK 5.6 and git head with x86_64 arch on OS X 10.6.4 using the system Python, although I've been able to build the python wrappers fine on other version for the past couple years. I don't think I've tried building i386 with Snow Leopard...)

-Eric

------------------------------------------------------
Eric E Monson
Duke Visualization Technology Group


On Jul 14, 2010, at 11:20 AM, Sensei wrote:

> Hi! I am trying to build VTK with python bindings (I need it for MayaVi), without any success so far.
>
> My VTK configuration has turned on VTK_WRAP_PYTHON and BUILD_SHARED_LIBS, while the CMAKE_OSX_ARCHITECTURES is set to i386.
>
> The first problem is met building it, but searching on the net I find that issuing "chmod 600 Utilities/vtktiff/tif_fax3sm.c" does the trick. And it did.
>
> The second problem I found was in the python installation process, since it uses /usr/local also for python:
>
> <shell>
> Checking .pth file support in /usr/local/lib/python2.6/site-packages/
> error: can't create or remove files in install directory
>
> The following error occurred while trying to add or remove files in the
> installation directory:
>
>    [Errno 2] No such file or directory: '/usr/local/lib/python2.6/site-packages/test-easy-install-57720.pth'
>
> The installation directory you specified (via --install-dir, --prefix, or
> the distutils default setting) was:
>
>    /usr/local/lib/python2.6/site-packages/
>
> This directory does not currently exist.  Please create it and try again, or
> choose a different installation directory (using the -d or --install-dir
> option).
> </shell>
>
> However, running "/usr/bin/python2.6 setup.py install" under VTK/Wrapping/Python (without the --prefix switch), worked for me. Or at least I thought so:
>
> <shell>
> $ cd Wrapping/Python && /usr/bin/python2.6 setup.py installrunning install
> running bdist_egg
> running egg_info
> creating VTK.egg-info
> ...
> creating 'dist/VTK-5.4.2-py2.6.egg' and adding 'build/bdist.macosx-10.6-universal/egg' to it
> removing 'build/bdist.macosx-10.6-universal/egg' (and everything under it)
> Processing VTK-5.4.2-py2.6.egg
> creating /Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg
> Extracting VTK-5.4.2-py2.6.egg to /Library/Python/2.6/site-packages
> Adding VTK 5.4.2 to easy-install.pth file
>
> Installed /Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg
> Processing dependencies for VTK==5.4.2
> Finished processing dependencies for VTK==5.4.2
> </shell>
>
> The problem is with shared libraries. Trying to start the MayaVi VTK test script, or even trying to import vtk from a python shell, I get the following problem:
>
> <shell>
> $ python test_vtk.py
> Testing if Tkinter is available...
> OK - you have Tkinter
> TclVersion = 8.5, TkVersion = 8.5
> Traceback (most recent call last):
>  File "test_vtk.py", line 210, in <module>
>    test_value_error()
>  File "test_vtk.py", line 178, in test_value_error
>    import vtk
>  File "/Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/__init__.py", line 41, in <module>
>    from common import *
>  File "/Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/common.py", line 7, in <module>
>    from libvtkCommonPython import *
> ImportError: dlopen(/Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/libvtkCommonPython.so, 10): no suitable image found.  Did find:
> /Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/libvtkCommonPython.so: mach-o, but wrong architecture
> </shell>
>
> This puzzles me for two reasons. First, the suffix is .so instead of the standard .dylib (I created there some symlinks with the dylib suffix, just in case). The second is simple: the architecture seems to be ok to me, although the file type might not be so:
>
> <shell>
> $ file /Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/libvtkCommonPython.so
> /Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/libvtkCommonPython.so: Mach-O bundle i386
> </shell>
>
> Why do I get this 'wrong architecture' error? Usually, shared libs have as file types "Mach-O universal binary", and not "bundle"...
>
> Can you walk me out of this?
>
> Thanks & cheers!
>
>
>
>
>
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Python Bindings on OSX?

Eric E. Monson
In reply to this post by David Gobbi
Just as a bit of followup info -- when you do an install the .so files end up in the VTK egg in /Library/Python/2.6/site-packages/VTK.../vtk, and they should contain internal paths to the ...PythonD.dylib libraries if you've built with VTK_USE_RPATH: ON (on my machine they refer back to the ones in the build/bin directory). You can check them with "otool -L path/to/libvtkCommonPython.so".

If all of these internal paths are correct, and the egg has been installed in the correct place, then you shouldn't have to modify the PYTHONPATH or DYLD_LIBRARY_PATH to get "import vtk" to work. If you don't want to build with RPATH ON for some reason, then the library path env variable setting is probably necessary to find the .dylib libraries.

-Eric


On Jul 14, 2010, at 12:13 PM, David Gobbi wrote:

> I can't comment on the installation issues because I always use VTK
> in-situ instead of doing an install.  For the other questions,
>
> The ".so" suffix denotes a loadable python module, and it is the
> correct suffix even though it is a shared object just like a .dylib.
> You will probably note that there is a libvtkCommonPython.so and a
> libvtkCommonPythonD.dylib.  The former contains the module
> initialization code, and the latter contains most of the python
> wrapper code.  The .so file must be somewhere in the PYTHONPATH and
> the .dylib must be somewhere in the DYLD_LIBRARY_PATH.
>
> The best architecture to use on 0S X 10.6 is x86_64, because that is
> the architecture that the python 2.6 executable uses when you run it
> from the command line.  The i386 architecture should only be used when
> building with python 2.5 for when you want to keep binary
> compatibility with OS X 10.5.
>
>   David
>
>
>
> On Wed, Jul 14, 2010 at 9:20 AM, Sensei <[hidden email]> wrote:
>> Hi! I am trying to build VTK with python bindings (I need it for MayaVi), without any success so far.
>>
>> My VTK configuration has turned on VTK_WRAP_PYTHON and BUILD_SHARED_LIBS, while the CMAKE_OSX_ARCHITECTURES is set to i386.
>>
>> The first problem is met building it, but searching on the net I find that issuing "chmod 600 Utilities/vtktiff/tif_fax3sm.c" does the trick. And it did.
>>
>> The second problem I found was in the python installation process, since it uses /usr/local also for python:
>>
>> <shell>
>> Checking .pth file support in /usr/local/lib/python2.6/site-packages/
>> error: can't create or remove files in install directory
>>
>> The following error occurred while trying to add or remove files in the
>> installation directory:
>>
>>    [Errno 2] No such file or directory: '/usr/local/lib/python2.6/site-packages/test-easy-install-57720.pth'
>>
>> The installation directory you specified (via --install-dir, --prefix, or
>> the distutils default setting) was:
>>
>>    /usr/local/lib/python2.6/site-packages/
>>
>> This directory does not currently exist.  Please create it and try again, or
>> choose a different installation directory (using the -d or --install-dir
>> option).
>> </shell>
>>
>> However, running "/usr/bin/python2.6 setup.py install" under VTK/Wrapping/Python (without the --prefix switch), worked for me. Or at least I thought so:
>>
>> <shell>
>> $ cd Wrapping/Python && /usr/bin/python2.6 setup.py installrunning install
>> running bdist_egg
>> running egg_info
>> creating VTK.egg-info
>> ...
>> creating 'dist/VTK-5.4.2-py2.6.egg' and adding 'build/bdist.macosx-10.6-universal/egg' to it
>> removing 'build/bdist.macosx-10.6-universal/egg' (and everything under it)
>> Processing VTK-5.4.2-py2.6.egg
>> creating /Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg
>> Extracting VTK-5.4.2-py2.6.egg to /Library/Python/2.6/site-packages
>> Adding VTK 5.4.2 to easy-install.pth file
>>
>> Installed /Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg
>> Processing dependencies for VTK==5.4.2
>> Finished processing dependencies for VTK==5.4.2
>> </shell>
>>
>> The problem is with shared libraries. Trying to start the MayaVi VTK test script, or even trying to import vtk from a python shell, I get the following problem:
>>
>> <shell>
>> $ python test_vtk.py
>> Testing if Tkinter is available...
>> OK - you have Tkinter
>> TclVersion = 8.5, TkVersion = 8.5
>> Traceback (most recent call last):
>>  File "test_vtk.py", line 210, in <module>
>>    test_value_error()
>>  File "test_vtk.py", line 178, in test_value_error
>>    import vtk
>>  File "/Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/__init__.py", line 41, in <module>
>>    from common import *
>>  File "/Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/common.py", line 7, in <module>
>>    from libvtkCommonPython import *
>> ImportError: dlopen(/Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/libvtkCommonPython.so, 10): no suitable image found.  Did find:
>>        /Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/libvtkCommonPython.so: mach-o, but wrong architecture
>> </shell>
>>
>> This puzzles me for two reasons. First, the suffix is .so instead of the standard .dylib (I created there some symlinks with the dylib suffix, just in case). The second is simple: the architecture seems to be ok to me, although the file type might not be so:
>>
>> <shell>
>> $ file /Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/libvtkCommonPython.so
>> /Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/libvtkCommonPython.so: Mach-O bundle i386
>> </shell>
>>
>> Why do I get this 'wrong architecture' error? Usually, shared libs have as file types "Mach-O universal binary", and not "bundle"...
>>
>> Can you walk me out of this?
>>
>> Thanks & cheers!
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Python Bindings on OSX?

sensei_sen

On Jul 14, 2010, at 6:23pm, Eric E. Monson wrote:

> Just as a bit of followup info -- when you do an install the .so files end up in the VTK egg in /Library/Python/2.6/site-packages/VTK.../vtk, and they should contain internal paths to the ...PythonD.dylib libraries if you've built with VTK_USE_RPATH: ON (on my machine they refer back to the ones in the build/bin directory). You can check them with "otool -L path/to/libvtkCommonPython.so".
>
> If all of these internal paths are correct, and the egg has been installed in the correct place, then you shouldn't have to modify the PYTHONPATH or DYLD_LIBRARY_PATH to get "import vtk" to work. If you don't want to build with RPATH ON for some reason, then the library path env variable setting is probably necessary to find the .dylib libraries.

Hi again!

I successfully built VTK with VTK_USE_RPATH=ON, but a new problem is troubling me. When running mayavi, python complains about a VTK library. Unfortunately, I can't find it anywhere:


<shell>
$ mayavi
Traceback (most recent call last):
  File "/usr/local/bin/mayavi", line 317, in <module>
    app = MayaViTkGUI (r)
  File "/Library/Python/2.6/site-packages/mayavi/Main.py", line 1009, in __init__
    self.renwin = Misc.RenderWindow.RenderWindow (self.renwin_frame)
  File "/Library/Python/2.6/site-packages/mayavi/Misc/RenderWindow.py", line 89, in __init__
    height=505)
  File "/Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/tk/vtkTkRenderWidget.py", line 81, in __init__
    vtkLoadPythonTkWidgets(master.tk)
  File "/Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/tk/vtkLoadPythonTkWidgets.py", line 65, in vtkLoadPythonTkWidgets
    interp.call('load', filename)
_tkinter.TclError: dlopen(libvtkRenderingPythonTkWidgets.dylib, 10): image not found
</shell>

The dynamic library is no where to be found on my system and in the VTK build directory:
$ find ~/Downloads/VTK -name "libvtkRenderingPythonTkWidgets.*"
$ find /Library/Python/2.6/ -name "libvtkRenderingPythonTkWidgets.*"


However, being curious, I ran otool on the VTK main library as you suggested:

<shell>
$ cd /Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk

$ otool -L libvtkCommonPython.so
libvtkCommonPython.so:
        /Users/sensei/Downloads/VTK/bin/libvtkCommonPythonD.5.4.dylib (compatibility version 5.4.0, current version 5.4.2)
        /System/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.1)
        /Users/sensei/Downloads/VTK/bin/libvtkCommon.5.4.dylib (compatibility version 5.4.0, current version 5.4.2)
        /Users/sensei/Downloads/VTK/bin/libvtksys.5.4.dylib (compatibility version 5.4.0, current version 5.4.2)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 123.0.0)
        /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
</shell>

Why does it point to my build directory?And why can't I find that "libvtkRenderingPythonTkWidgets.dylib" library?

I'm starting to hate python-esque errors! :)

Cheers & thanks!
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Python Bindings on OSX?

David Gobbi
On Mon, Jul 19, 2010 at 7:07 AM, Sensei <[hidden email]> wrote:

>
> On Jul 14, 2010, at 6:23pm, Eric E. Monson wrote:
>
>> Just as a bit of followup info -- when you do an install the .so files end up in the VTK egg in /Library/Python/2.6/site-packages/VTK.../vtk, and they should contain internal paths to the ...PythonD.dylib libraries if you've built with VTK_USE_RPATH: ON (on my machine they refer back to the ones in the build/bin directory). You can check them with "otool -L path/to/libvtkCommonPython.so".
>>
>> If all of these internal paths are correct, and the egg has been installed in the correct place, then you shouldn't have to modify the PYTHONPATH or DYLD_LIBRARY_PATH to get "import vtk" to work. If you don't want to build with RPATH ON for some reason, then the library path env variable setting is probably necessary to find the .dylib libraries.
>
> Hi again!
>
> I successfully built VTK with VTK_USE_RPATH=ON, but a new problem is troubling me. When running mayavi, python complains about a VTK library. Unfortunately, I can't find it anywhere:
>
>
> <shell>
> $ mayavi
> Traceback (most recent call last):
>  File "/usr/local/bin/mayavi", line 317, in <module>
>    app = MayaViTkGUI (r)
>  File "/Library/Python/2.6/site-packages/mayavi/Main.py", line 1009, in __init__
>    self.renwin = Misc.RenderWindow.RenderWindow (self.renwin_frame)
>  File "/Library/Python/2.6/site-packages/mayavi/Misc/RenderWindow.py", line 89, in __init__
>    height=505)
>  File "/Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/tk/vtkTkRenderWidget.py", line 81, in __init__
>    vtkLoadPythonTkWidgets(master.tk)
>  File "/Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk/tk/vtkLoadPythonTkWidgets.py", line 65, in vtkLoadPythonTkWidgets
>    interp.call('load', filename)
> _tkinter.TclError: dlopen(libvtkRenderingPythonTkWidgets.dylib, 10): image not found
> </shell>
>
> The dynamic library is no where to be found on my system and in the VTK build directory:
> $ find ~/Downloads/VTK -name "libvtkRenderingPythonTkWidgets.*"
> $ find /Library/Python/2.6/ -name "libvtkRenderingPythonTkWidgets.*"
>
>
> However, being curious, I ran otool on the VTK main library as you suggested:
>
> <shell>
> $ cd /Library/Python/2.6/site-packages/VTK-5.4.2-py2.6.egg/vtk
>
> $ otool -L libvtkCommonPython.so
> libvtkCommonPython.so:
>        /Users/sensei/Downloads/VTK/bin/libvtkCommonPythonD.5.4.dylib (compatibility version 5.4.0, current version 5.4.2)
>        /System/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.1)
>        /Users/sensei/Downloads/VTK/bin/libvtkCommon.5.4.dylib (compatibility version 5.4.0, current version 5.4.2)
>        /Users/sensei/Downloads/VTK/bin/libvtksys.5.4.dylib (compatibility version 5.4.0, current version 5.4.2)
>        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 123.0.0)
>        /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
> </shell>
>
> Why does it point to my build directory?And why can't I find that "libvtkRenderingPythonTkWidgets.dylib" library?
>
> I'm starting to hate python-esque errors! :)
>
> Cheers & thanks!

I'll leave the RPATH questions for someone else, but I can answer the
libvtkRenderingPythonTkWidgets.dylib questions.  This library is
needed so that VTK can use Python's Tkinter module, which is needed
for MayaVi.

On OS X 10.6, Tkinter (and Tk) use Cocoa (on OS X 10.5, they use
Carbon).  VTK did not support building
libvtkRenderingPythonTkWidgets.dylib with Cocoa until VTK 5.6.  So if
you build VTK 5.4 on OS X 10.6, you won't get the
libvtkRenderingPythonTkWidgets.

  David
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Python Bindings on OSX?

sensei_sen

On Jul 19, 2010, at 3:21pm, David Gobbi wrote:


> I'll leave the RPATH questions for someone else, but I can answer the
> libvtkRenderingPythonTkWidgets.dylib questions.  This library is
> needed so that VTK can use Python's Tkinter module, which is needed
> for MayaVi.
>
> On OS X 10.6, Tkinter (and Tk) use Cocoa (on OS X 10.5, they use
> Carbon).  VTK did not support building
> libvtkRenderingPythonTkWidgets.dylib with Cocoa until VTK 5.6.  So if
> you build VTK 5.4 on OS X 10.6, you won't get the
> libvtkRenderingPythonTkWidgets.


Thanks for the pointer! However, I cannot run MayaVi because the libvtkRenderingPythonTkWidgets.dylib is still missing (VTK 5.6).

My configuration for VTK is BUILD_SHARED_LIBS=ON, VTK_WRAP_PYTHON=ON, VTK_WRAP_TCL=ON, VTK_USE_RPATH=ON, but then again:

$ mayavi
Traceback (most recent call last):
  File "/usr/local/bin/mayavi", line 317, in <module>
    app = MayaViTkGUI (r)
  File "/Library/Python/2.6/site-packages/mayavi/Main.py", line 1009, in __init__
    self.renwin = Misc.RenderWindow.RenderWindow (self.renwin_frame)
  File "/Library/Python/2.6/site-packages/mayavi/Misc/RenderWindow.py", line 89, in __init__
    height=505)
  File "/Library/Python/2.6/site-packages/VTK-5.6.0-py2.6.egg/vtk/tk/vtkTkRenderWidget.py", line 81, in __init__
    vtkLoadPythonTkWidgets(master.tk)
  File "/Library/Python/2.6/site-packages/VTK-5.6.0-py2.6.egg/vtk/tk/vtkLoadPythonTkWidgets.py", line 69, in vtkLoadPythonTkWidgets
    interp.call('load', filename)
_tkinter.TclError: dlopen(libvtkRenderingPythonTkWidgets.dylib, 10): image not found


And surprisingly, the very same library you pointed out is NOT installed:

$ find /Library/Python -name libvtkRenderingPythonTkWidgets.dylib
(NO OUTPUT)

Although that library IS present in the VTK build dir:

$ ls bin/libvtkRenderingPythonTkWidgets.*
bin/libvtkRenderingPythonTkWidgets.5.6.0.dylib*
bin/libvtkRenderingPythonTkWidgets.5.6.dylib@
bin/libvtkRenderingPythonTkWidgets.dylib@


The funny stuff is this: without RPATH, I get a library path problem (image of python-common not found), with RPATH on I get this Tk problem (even with VTK 5.6), and probably I miss the point of relative paths, since the python common library has absolute paths in it:

$ otool -L /Library/Python/2.6/site-packages/VTK-5.6.0-py2.6.egg/vtk/libvtkCommonPython.so
/Library/Python/2.6/site-packages/VTK-5.6.0-py2.6.egg/vtk/libvtkCommonPython.so:
        /Users/sensei/Downloads/VTK/bin/libvtkCommonPythonD.5.6.dylib (compatibility version 5.6.0, current version 5.6.0)
        /System/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.1)
        /Users/sensei/Downloads/VTK/bin/libvtkCommon.5.6.dylib (compatibility version 5.6.0, current version 5.6.0)
        /Users/sensei/Downloads/VTK/bin/libvtksys.5.6.dylib (compatibility version 5.6.0, current version 5.6.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 123.0.0)
        /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)


I am puzzled... I am attaching some parts of CMakeCache.txt, maybe I am missing some obvious point!

Cheers!




//Build Verdict with shared libraries.
BUILD_SHARED_LIBS:BOOL=ON

//Install path prefix, prepended onto install directories.
CMAKE_INSTALL_PREFIX:PATH=/usr/local

//The product will be built against the headers and libraries located
// inside the indicated SDK.
CMAKE_OSX_SYSROOT:PATH=/Developer/SDKs/MacOSX10.6.sdk

//Value Computed by CMake
CMAKE_PROJECT_NAME:STATIC=VTK

//Add module vtkChartsPython
PYTHON_ENABLE_MODULE_vtkChartsPython:BOOL=ON

//Add module vtkCommonPython
PYTHON_ENABLE_MODULE_vtkCommonPython:BOOL=ON

//Add module vtkFilteringPython
PYTHON_ENABLE_MODULE_vtkFilteringPython:BOOL=ON

//Add module vtkGenericFilteringPython
PYTHON_ENABLE_MODULE_vtkGenericFilteringPython:BOOL=ON

//Add module vtkGeovisPython
PYTHON_ENABLE_MODULE_vtkGeovisPython:BOOL=ON

//Add module vtkGraphicsPython
PYTHON_ENABLE_MODULE_vtkGraphicsPython:BOOL=ON

//Add module vtkHybridPython
PYTHON_ENABLE_MODULE_vtkHybridPython:BOOL=ON

//Add module vtkIOPython
PYTHON_ENABLE_MODULE_vtkIOPython:BOOL=ON

//Add module vtkImagingPython
PYTHON_ENABLE_MODULE_vtkImagingPython:BOOL=ON

//Add module vtkInfovisPython
PYTHON_ENABLE_MODULE_vtkInfovisPython:BOOL=ON

//Add module vtkRenderingPython
PYTHON_ENABLE_MODULE_vtkRenderingPython:BOOL=ON

//Add module vtkViewsPython
PYTHON_ENABLE_MODULE_vtkViewsPython:BOOL=ON

//Add module vtkVolumeRenderingPython
PYTHON_ENABLE_MODULE_vtkVolumeRenderingPython:BOOL=ON

//Add module vtkWidgetsPython
PYTHON_ENABLE_MODULE_vtkWidgetsPython:BOOL=ON

//Add module vtkChartsPython shared
PYTHON_MODULE_vtkChartsPython_BUILD_SHARED:BOOL=ON

//Add module vtkCommonPython shared
PYTHON_MODULE_vtkCommonPython_BUILD_SHARED:BOOL=ON

//Add module vtkFilteringPython shared
PYTHON_MODULE_vtkFilteringPython_BUILD_SHARED:BOOL=ON

//Add module vtkGenericFilteringPython shared
PYTHON_MODULE_vtkGenericFilteringPython_BUILD_SHARED:BOOL=ON

//Add module vtkGeovisPython shared
PYTHON_MODULE_vtkGeovisPython_BUILD_SHARED:BOOL=ON

//Add module vtkGraphicsPython shared
PYTHON_MODULE_vtkGraphicsPython_BUILD_SHARED:BOOL=ON

//Add module vtkHybridPython shared
PYTHON_MODULE_vtkHybridPython_BUILD_SHARED:BOOL=ON

//Add module vtkIOPython shared
PYTHON_MODULE_vtkIOPython_BUILD_SHARED:BOOL=ON

//Add module vtkImagingPython shared
PYTHON_MODULE_vtkImagingPython_BUILD_SHARED:BOOL=ON

//Add module vtkInfovisPython shared
PYTHON_MODULE_vtkInfovisPython_BUILD_SHARED:BOOL=ON

//Add module vtkRenderingPython shared
PYTHON_MODULE_vtkRenderingPython_BUILD_SHARED:BOOL=ON

//Add module vtkViewsPython shared
PYTHON_MODULE_vtkViewsPython_BUILD_SHARED:BOOL=ON

//Add module vtkVolumeRenderingPython shared
PYTHON_MODULE_vtkVolumeRenderingPython_BUILD_SHARED:BOOL=ON

//Add module vtkWidgetsPython shared
PYTHON_MODULE_vtkWidgetsPython_BUILD_SHARED:BOOL=ON

//Build classes using Carbon API.
VTK_USE_CARBON:BOOL=OFF

//Build pixel and vertex shader support for Cg.
VTK_USE_CG_SHADERS:BOOL=OFF

//Build VTK chart support (OpenGL based)
VTK_USE_CHARTS:BOOL=ON

//Build classes using Cocoa API.
VTK_USE_COCOA:BOOL=ON

//Build the vtkRendering kit.  Needed for displaying data or using
// widgets.
VTK_USE_RENDERING:BOOL=ON

//Build shared libraries with rpath.  This makes it easy to run
// executables from the build tree when using shared libraries,
// but removes install support.
VTK_USE_RPATH:BOOL=ON

//Build VTK with Tk support
VTK_USE_TK:BOOL=ON

//Wrap VTK classes into the Python language.
VTK_WRAP_PYTHON:BOOL=ON

//Wrap VTK classes into the TCL language.
VTK_WRAP_TCL:BOOL=ON










_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Python Bindings on OSX?

David Gobbi
Again, I cannot offer insight into the RPATH or install issues, but I
can give some more information about
ibvtkRenderingPythonTkWidgets.dylib.  This library is not a not a
typical library, it is actually a loadable Tk module.  For it to be
loaded, it must be placed somewhere it either Python's module path, or
somewhere in Tcl's module path.  The RPATH has no effect on whether
this particular library is loaded, since python loads it manually.

The best place for it to be installed is wherever the python .so files
are installed.  If it is put in with the .so files, then it should be
loaded when it is needed.

  David


On Wed, Jul 21, 2010 at 6:11 AM, Sensei <[hidden email]> wrote:

>
> On Jul 19, 2010, at 3:21pm, David Gobbi wrote:
>
>
>> I'll leave the RPATH questions for someone else, but I can answer the
>> libvtkRenderingPythonTkWidgets.dylib questions.  This library is
>> needed so that VTK can use Python's Tkinter module, which is needed
>> for MayaVi.
>>
>> On OS X 10.6, Tkinter (and Tk) use Cocoa (on OS X 10.5, they use
>> Carbon).  VTK did not support building
>> libvtkRenderingPythonTkWidgets.dylib with Cocoa until VTK 5.6.  So if
>> you build VTK 5.4 on OS X 10.6, you won't get the
>> libvtkRenderingPythonTkWidgets.
>
>
> Thanks for the pointer! However, I cannot run MayaVi because the libvtkRenderingPythonTkWidgets.dylib is still missing (VTK 5.6).
>
> My configuration for VTK is BUILD_SHARED_LIBS=ON, VTK_WRAP_PYTHON=ON, VTK_WRAP_TCL=ON, VTK_USE_RPATH=ON, but then again:
>
> $ mayavi
> Traceback (most recent call last):
>  File "/usr/local/bin/mayavi", line 317, in <module>
>    app = MayaViTkGUI (r)
>  File "/Library/Python/2.6/site-packages/mayavi/Main.py", line 1009, in __init__
>    self.renwin = Misc.RenderWindow.RenderWindow (self.renwin_frame)
>  File "/Library/Python/2.6/site-packages/mayavi/Misc/RenderWindow.py", line 89, in __init__
>    height=505)
>  File "/Library/Python/2.6/site-packages/VTK-5.6.0-py2.6.egg/vtk/tk/vtkTkRenderWidget.py", line 81, in __init__
>    vtkLoadPythonTkWidgets(master.tk)
>  File "/Library/Python/2.6/site-packages/VTK-5.6.0-py2.6.egg/vtk/tk/vtkLoadPythonTkWidgets.py", line 69, in vtkLoadPythonTkWidgets
>    interp.call('load', filename)
> _tkinter.TclError: dlopen(libvtkRenderingPythonTkWidgets.dylib, 10): image not found
>
>
> And surprisingly, the very same library you pointed out is NOT installed:
>
> $ find /Library/Python -name libvtkRenderingPythonTkWidgets.dylib
> (NO OUTPUT)
>
> Although that library IS present in the VTK build dir:
>
> $ ls bin/libvtkRenderingPythonTkWidgets.*
> bin/libvtkRenderingPythonTkWidgets.5.6.0.dylib*
> bin/libvtkRenderingPythonTkWidgets.5.6.dylib@
> bin/libvtkRenderingPythonTkWidgets.dylib@
>
>
> The funny stuff is this: without RPATH, I get a library path problem (image of python-common not found), with RPATH on I get this Tk problem (even with VTK 5.6), and probably I miss the point of relative paths, since the python common library has absolute paths in it:
>
> $ otool -L /Library/Python/2.6/site-packages/VTK-5.6.0-py2.6.egg/vtk/libvtkCommonPython.so
> /Library/Python/2.6/site-packages/VTK-5.6.0-py2.6.egg/vtk/libvtkCommonPython.so:
>        /Users/sensei/Downloads/VTK/bin/libvtkCommonPythonD.5.6.dylib (compatibility version 5.6.0, current version 5.6.0)
>        /System/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.1)
>        /Users/sensei/Downloads/VTK/bin/libvtkCommon.5.6.dylib (compatibility version 5.6.0, current version 5.6.0)
>        /Users/sensei/Downloads/VTK/bin/libvtksys.5.6.dylib (compatibility version 5.6.0, current version 5.6.0)
>        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 123.0.0)
>        /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
>
>
> I am puzzled... I am attaching some parts of CMakeCache.txt, maybe I am missing some obvious point!
>
> Cheers!
>
>
>
>
> //Build Verdict with shared libraries.
> BUILD_SHARED_LIBS:BOOL=ON
>
> //Install path prefix, prepended onto install directories.
> CMAKE_INSTALL_PREFIX:PATH=/usr/local
>
> //The product will be built against the headers and libraries located
> // inside the indicated SDK.
> CMAKE_OSX_SYSROOT:PATH=/Developer/SDKs/MacOSX10.6.sdk
>
> //Value Computed by CMake
> CMAKE_PROJECT_NAME:STATIC=VTK
>
> //Add module vtkChartsPython
> PYTHON_ENABLE_MODULE_vtkChartsPython:BOOL=ON
>
> //Add module vtkCommonPython
> PYTHON_ENABLE_MODULE_vtkCommonPython:BOOL=ON
>
> //Add module vtkFilteringPython
> PYTHON_ENABLE_MODULE_vtkFilteringPython:BOOL=ON
>
> //Add module vtkGenericFilteringPython
> PYTHON_ENABLE_MODULE_vtkGenericFilteringPython:BOOL=ON
>
> //Add module vtkGeovisPython
> PYTHON_ENABLE_MODULE_vtkGeovisPython:BOOL=ON
>
> //Add module vtkGraphicsPython
> PYTHON_ENABLE_MODULE_vtkGraphicsPython:BOOL=ON
>
> //Add module vtkHybridPython
> PYTHON_ENABLE_MODULE_vtkHybridPython:BOOL=ON
>
> //Add module vtkIOPython
> PYTHON_ENABLE_MODULE_vtkIOPython:BOOL=ON
>
> //Add module vtkImagingPython
> PYTHON_ENABLE_MODULE_vtkImagingPython:BOOL=ON
>
> //Add module vtkInfovisPython
> PYTHON_ENABLE_MODULE_vtkInfovisPython:BOOL=ON
>
> //Add module vtkRenderingPython
> PYTHON_ENABLE_MODULE_vtkRenderingPython:BOOL=ON
>
> //Add module vtkViewsPython
> PYTHON_ENABLE_MODULE_vtkViewsPython:BOOL=ON
>
> //Add module vtkVolumeRenderingPython
> PYTHON_ENABLE_MODULE_vtkVolumeRenderingPython:BOOL=ON
>
> //Add module vtkWidgetsPython
> PYTHON_ENABLE_MODULE_vtkWidgetsPython:BOOL=ON
>
> //Add module vtkChartsPython shared
> PYTHON_MODULE_vtkChartsPython_BUILD_SHARED:BOOL=ON
>
> //Add module vtkCommonPython shared
> PYTHON_MODULE_vtkCommonPython_BUILD_SHARED:BOOL=ON
>
> //Add module vtkFilteringPython shared
> PYTHON_MODULE_vtkFilteringPython_BUILD_SHARED:BOOL=ON
>
> //Add module vtkGenericFilteringPython shared
> PYTHON_MODULE_vtkGenericFilteringPython_BUILD_SHARED:BOOL=ON
>
> //Add module vtkGeovisPython shared
> PYTHON_MODULE_vtkGeovisPython_BUILD_SHARED:BOOL=ON
>
> //Add module vtkGraphicsPython shared
> PYTHON_MODULE_vtkGraphicsPython_BUILD_SHARED:BOOL=ON
>
> //Add module vtkHybridPython shared
> PYTHON_MODULE_vtkHybridPython_BUILD_SHARED:BOOL=ON
>
> //Add module vtkIOPython shared
> PYTHON_MODULE_vtkIOPython_BUILD_SHARED:BOOL=ON
>
> //Add module vtkImagingPython shared
> PYTHON_MODULE_vtkImagingPython_BUILD_SHARED:BOOL=ON
>
> //Add module vtkInfovisPython shared
> PYTHON_MODULE_vtkInfovisPython_BUILD_SHARED:BOOL=ON
>
> //Add module vtkRenderingPython shared
> PYTHON_MODULE_vtkRenderingPython_BUILD_SHARED:BOOL=ON
>
> //Add module vtkViewsPython shared
> PYTHON_MODULE_vtkViewsPython_BUILD_SHARED:BOOL=ON
>
> //Add module vtkVolumeRenderingPython shared
> PYTHON_MODULE_vtkVolumeRenderingPython_BUILD_SHARED:BOOL=ON
>
> //Add module vtkWidgetsPython shared
> PYTHON_MODULE_vtkWidgetsPython_BUILD_SHARED:BOOL=ON
>
> //Build classes using Carbon API.
> VTK_USE_CARBON:BOOL=OFF
>
> //Build pixel and vertex shader support for Cg.
> VTK_USE_CG_SHADERS:BOOL=OFF
>
> //Build VTK chart support (OpenGL based)
> VTK_USE_CHARTS:BOOL=ON
>
> //Build classes using Cocoa API.
> VTK_USE_COCOA:BOOL=ON
>
> //Build the vtkRendering kit.  Needed for displaying data or using
> // widgets.
> VTK_USE_RENDERING:BOOL=ON
>
> //Build shared libraries with rpath.  This makes it easy to run
> // executables from the build tree when using shared libraries,
> // but removes install support.
> VTK_USE_RPATH:BOOL=ON
>
> //Build VTK with Tk support
> VTK_USE_TK:BOOL=ON
>
> //Wrap VTK classes into the Python language.
> VTK_WRAP_PYTHON:BOOL=ON
>
> //Wrap VTK classes into the TCL language.
> VTK_WRAP_TCL:BOOL=ON
>
>
>
>
>
>
>
>
>
>
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Python Bindings on OSX?

sensei_sen

On Jul 21, 2010, at 3:10pm, David Gobbi wrote:

> Again, I cannot offer insight into the RPATH or install issues, but I
> can give some more information about
> ibvtkRenderingPythonTkWidgets.dylib.  This library is not a not a
> typical library, it is actually a loadable Tk module.  For it to be
> loaded, it must be placed somewhere it either Python's module path, or
> somewhere in Tcl's module path.  The RPATH has no effect on whether
> this particular library is loaded, since python loads it manually.
>
> The best place for it to be installed is wherever the python .so files
> are installed.  If it is put in with the .so files, then it should be
> loaded when it is needed.


Unfortunately, that wasn't sufficient to make the trick. However, setting PYTHONPATH made my day. Maybe this was completely obvious to all of you, but not to me :)

Cheers!

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Loading...