[vtkusers] VTK & Python on MacOS X: Local vs. system installation]

Tom Bridgman bridgman at wyeth.gsfc.nasa.gov
Wed Sep 24 10:50:10 EDT 2003


Yves,

Picking up from the other thread where I mention I'm still using gcc
v3.1...

Per other suggestions on this thread:

I rebuilt with BUILD_TESTING=OFF and CMAKE_SKIP_RPATH=ON:

% make
% sudo make install
% cd Wrapping/Python
% sudo python setup.py install

I still get the import error looking for libraries in my local source
area.

LD_LIBRARY_PATH has /usr/local/lib/vtk/

PYTHONPATH has /usr/local/lib/vtk

I noticed that /usr/local/lib/vtk just has the lib*.so files while
/Users/bridgman/Development/VTK/bin has lib*.so & lib*.dylib files.

I copied the lib*.dylib files over to /usr/local/lib/vtk as well and
still I get

hitchcock 2% pythonw Development/VTK/Examples/Medical/Python/Medical3.py 
Traceback (most recent call last):
  File "Development/VTK/Examples/Medical/Python/Medical3.py", line 7, in
?
    import vtk
  File
"/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/vtk_python/vtk/__init__.py",
line 27, in ?
    from common import *
  File
"/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/vtk_python/vtk/common.py",
line 7, in ?
    from libvtkCommonPython import *
ImportError: Failure linking new module:
/Users/bridgman/Development/VTK/bin/libvtkCommonPythonD.dylib: dyld:
/Library/Frameworks/Python.framework/Versions/2.3/Resources/Python.app/Contents/MacOS/Python
can't open library:
/Users/bridgman/Development/VTK/bin/libvtkCommonPythonD.dylib  (No such
file or directory, errno = 2)

when /Users/bridgman/Development/VTK/bin is renamed to VTK/bin1/.

When the VTK/bin/ directory is available, the above demo works
beautifully.

I tried MayaVi again last night on my home system with the newer build
setting described above and it still segfaults.

Any other ideas?

Thanks,
Tom

Yves Starreveld wrote:
> 
> Tom,
> 
> Glad to almost hear everything works.
> 
> OSX is a little different (as I'm sure you have surmised).
> 
> In order for an application to receive events from the window manager,
> it must be registered with the window manager. The only two ways for
> that to happen are with an obscure, undocumented system call, or to run
> the application from an 'App wrapper' which has an appropriate
> Info.plist file within it.
> 
> This is why you need to use Python2.3, since it comes with a simple
> solution for this.
> 
> Instead of typing python (or vtkpython), use pythonw.
> 
> If you did a binary install of python2.3, pythonw will have been
> installed also. It is simply a script that calls an executable python
> which is installed in an app wrapper.
> 
> Your vtk application will run, and you can interact with it. (you _did_
> get a 3 button mouse, I hope!)
> 
> Yves
> 
> On Tuesday, September 23, 2003, at 08:32  AM, Tom Bridgman wrote:
> 
> > Thanks to some feedback and a header file update from Yves, I finally
> > got VTK to build under OS X 10.2.6 with the python wrappers.
> >
> > However, when running the wrappers in the source directory, say VTK/, I
> > can get the python demos to run with commands like:
> >
> >> ./bin/vtkpython Examples/Rendering/Python/Medical3.py
> >
> > The dataset works beautifully, with 'vtkX - Carbon #1' in the title
> > bar.
> >
> > I can do a
> >> sudo make install
> > to make the package available system-wide, then generating the python
> > wrappers with
> >> sudo python setup.py install
> > in the Wrapping/Python directory.
> >
> > It even seems to import vtk from regular python.
> >
> > Now when I launch the same demo using the system-wide executable, the
> > window doesn't come to the forefront and is downright unresponsive.
> > When I tried to install and use MayaVi, I'd get segfaults.
> >
> > Deleting the vtk components in /usr/local/bin and /usr/local/lib
> > resolves the problem.  I also noticed that if I moved the source
> > directory, vtkpython still seemed to want dylib files in the source
> > directory.
> >
> > I suspect this is a path problem, but which paths?  Alternatively,
> > should I have built the python wrappers *before* doing 'make install'?
> > This step isn't so clear in the README.html.  I'm *so close* to getting
> > MayaVi running on this system!
> >
> > Thanks,
> > Tom
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at:
> > <http://public.kitware.com/cgi-bin/vtkfaq>
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
> 
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers

--
Dr. William T."Tom" Bridgman           Scientific Visualization Studio
Global Science & Technology, Inc.      NASA/Goddard Space Flight Center
Email: bridgman at wyeth.gsfc.nasa.gov    Code 935
Phone: 301-286-1346                    Greenbelt, MD 20771
FAX:   TBD                             http://svs.gsfc.nasa.gov/



More information about the vtkusers mailing list