PyQt on a Server

B

Bob Parnes

I have an application importing qt on a linux server and am missing
something in trying to run it from a workstation via nfs. The
workstation has the server /usr directory mounted to its own /usr
directory, so it can access the necessary files. The error I get is

Traceback (most recent call last):
File "/demo/revenues.py", line 24, in ?
from qt import *
File "/usr/lib/python2.3/site-packages/qt.py", line 24, in ?
import libsip
ImportError: libXrender.so.1: cannot open shared object file:
No such file or directory

I can see the file in /usr/X11R6/lib. So maybe there is a path variable
that qt.py uses and that has to be set on the workstation. If so, I don't
know how to find it. Thanks for any help.

Bob
 
P

Phil Thompson

This is likely to be a Qt/X setup problem - PyQt doesn't explicitly call
Xrender.

Does your workstation /etc/ld.so.conf contain a line for /usr/X11R6/lib?

Phil
 
J

Jerry Sievers

Bob Parnes said:
I have an application importing qt on a linux server and am missing
something in trying to run it from a workstation via nfs. The
workstation has the server /usr directory mounted to its own /usr
directory, so it can access the necessary files. The error I get is

Traceback (most recent call last):
File "/demo/revenues.py", line 24, in ?
from qt import *
File "/usr/lib/python2.3/site-packages/qt.py", line 24, in ?
import libsip
ImportError: libXrender.so.1: cannot open shared object file:
No such file or directory

I can see the file in /usr/X11R6/lib. So maybe there is a path variable
that qt.py uses and that has to be set on the workstation. If so, I don't
know how to find it. Thanks for any help.


LD_LIBRARY_PATH=/usr/X11R6/lib

or if the LD_LIBRARY_PATH exists already, append to it;

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/X11R6/lib

then

export LD_LIBRARY_PATH

Now try running your Python script and see if this helps. If so, read
about ld.config and add that lib to the standard config on the
workstation if you plan on having that NFS mount all the time.

You might also check to insure that the lib that you are "seeing" is
actually a file and not a symlink to nowhere and that the file has
appropriate perms for a shared lib r-x is typical.

HTH
 
B

Bob Parnes

LD_LIBRARY_PATH=/usr/X11R6/lib

or if the LD_LIBRARY_PATH exists already, append to it;

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/X11R6/lib

then

export LD_LIBRARY_PATH

Yes, this works.
Now try running your Python script and see if this helps. If so, read
about ld.config and add that lib to the standard config on the
workstation if you plan on having that NFS mount all the time.

my /etc/ld.so.conf file already has that lib in it. So something else is
happening, but it clearly has nothing to do with python.
You might also check to insure that the lib that you are "seeing" is
actually a file and not a symlink to nowhere and that the file has
appropriate perms for a shared lib r-x is typical.

HTH

The lib is a symlink to another file in the same directory, and the
permissions seem to be okay. Thanks very much for your help.
 
J

Jerry Sievers

Bob Parnes said:
my /etc/ld.so.conf file already has that lib in it. So something else is
happening, but it clearly has nothing to do with python.

Have you run ldconfig (probably /sbin/ldconfig) since the line was
added to the /etc ld config file?
 
B

Bob Parnes

Have you run ldconfig (probably /sbin/ldconfig) since the line was
added to the /etc ld config file?

Good question. I have not done this often, and the need to run ldconfig after
mounting the server /usr directory did not occur to me. So I tried
again, running ldconfig, and it still didn't work. After more checking,
I found that the entry in /etc/ld.so.conf was "usr/X11R6/lib", instead
of "/usr/X11R6/lib". I guess that was good enough during bootup. So adding
the slash and running ldconfig again fixed everything. Thanks very much.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,832
Latest member
UtaHetrick

Latest Threads

Top