[Leaplist] Python question ....
Mark W. Alexander
slash at dotnetslash.net
Tue Jan 16 19:16:13 EST 2007
On Tue, Jan 16, 2007 at 03:00:34PM -0600, William A. Mahaffey III wrote:
>
> .... let me begin by saying I don't know *squat* about python :-). I am
> trying to install a package called mayavi on our new x86-64 FC6 Linux
> box at work. Mayavi is a python-based Graphics app. It requires some
> other packages as well (vtk & tkinter), each of which had its own
> burgeoning dependency requirements. I got all of that (apparently)
> resolved. However, mayavi still won't run, giving me error messages that
> I *think* are related to mis-configuration of my install of vtk (see
> attached). I *did* rtfm, & tried various permutations of environment
> variables to try to resolve the problem, w/ no luck. Can anyone tell me
> what I have screwed up here :-) ? TIA ....
Since most of what you show indicates stuff going to /usr/local I'm guessing
you didn't use the binary RPMS? (Oohh... I see they only support RH9... Red
Flag! This stuff might be a little out of date ;) I'm not familiar with any of
these packages but the only install instructions I see refer to Distutils and
it should get everything in the right place for Python to "just work."
Did you use the command "python setup.py install" to install? It doesn't look
like you did, or if you did you didn't conjure with the correct incantation ;)
Try starting with "python setup.py --help" for some interesting options. (This
is the heart of Python's 'Distutils' package support) You should see options
that you can use to point to different library. You'll also see that setup.py
has additional commands, each of which has more help. For example, if you want
to build an rpm, use "python setup.py bdist_rpm" and it will do the default
thing. Use "python setup.py bdist_rpm --help" for help on options specific to
producing an rpm.
The following provides some insight:
> [lws at C2Da.RSI.COM ~/test] 1:43:10pm 440 % setenv PYTHONPATH /usr/local/lib/python2.4/site-packages/
> [lws at C2Da.RSI.COM ~/test] 1:43:14pm 441 % mayavi
> Traceback (most recent call last):
> File "/usr/bin/mayavi", line 289, in ?
> import vtk
> File "/usr/local/lib/python2.4/site-packages/vtk/__init__.py", line 29, in ?
> from common import *
> File "/usr/local/lib/python2.4/site-packages/vtk/common.py", line 7, in ?
> from libvtkCommonPython import *
> ImportError: libvtkCommonPythonD.so.5.0: cannot open shared object file: No such file or directory
> [lws at C2Da.RSI.COM ~/test] 1:43:16pm 442 %
Since "import vtk" is finding the python vtk module, that's the "right"
PYTHONPATH. Since you have to specify PYTHONPATH in the first place, it tells
me you did something wrong in installing the package. Distutils should have
installed in the site-packages subdirectory of your base Python installation.
Of course it's possible that they foobared their setup.py or setup.cfg, but
they are usually to simple to screw up much. Then again, if ALL the above C
[libraries, etc.] are being build by setup.py, it's a little more complicated
and could be borked.
You can take a 1/2 step with "python setup.py build" That command should create
a "build" subdirectory in the current work directory. Setting PYTHONPATH to
"$(pwd)/build/lib" should work if the package is properly self-contained.
The real problem in the snippet above is that the vtk Python module can't find
the file libvtkCommonPythonD.so.5 in /usr/local/lib. You need to either a) find
the what put it there and tell it to go into /usr/lib, b) find the setup.py
options to say "look for libraries in /usr/local/lib, or c) tell your libc to
also look in /usr/local/lib by updating /etc/ld.so.conf and running ldconfig.
hth!
mwa
--
Mark W. Alexander
slash at dotnetslash.net
The contents of this message authored by Mark W. Alexander are released under
the Creative Commons Attribution-NonCommercial license. Copyright of quoted
materials, if any, are retained by the original author(s).
http://creativecommons.org/licenses/by-nc/2.0/
More information about the Leaplist
mailing list