Interactive os.environ vs. os.environ in script
boris.smirnov at gmail.com
boris.smirnov at gmail.com
Tue Feb 27 02:43:32 EST 2007
On Feb 26, 5:44 pm, Thinker <thin... at branda.to> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
>
>
>
> boris.smir... at gmail.com wrote:
>
> > OK then I have to reformulate my question. :)
>
> > In my script I have a line with
>
> > os.environ["LD_LIBRARY_PATH"]='/path/Linux/rh_linux'
>
> > but this line didn't work. But when I set this environment variable
> > in Linux shell it works. Here is a small example.
>
> >> python shrink_bs_070226.py
> > Traceback (most recent call last): File "shrink_bs_070226.py", line
> > 25, in ? from qt import * File
> > "/path/Linux/python/rh_linux/lib/python2.2/site-packages/ qt.py",
> > line 46, in ? import libsip ImportError: libadamsqt.so: cannot open
> > shared object file: No such file or directory
>
> ld-elf.so reads environment variables when it was loaded.
> It never reads environment variables again!
> That you setting environment in the process does not make link-editor
> to re-read environment variable and take effect.
>
> To resolve the problem, you can try to add the path to sys.path.
>
> - --
> Thinker Li - thin... at branda.to thinker... at gmail.comhttp://heaven.branda.to/~thinker/GinGin_CGI.py
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (FreeBSD)
> Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org
>
> iD8DBQFF4w6H1LDUVnWfY8gRAoI0AKCLikYsFU2N6aaOZFDd1L2KY8DjqACg3QQn
> KsEEcrvpw1CktEkVCKe/ojk=
> =EQG6
> -----END PGP SIGNATURE------ Hide quoted text -
>
> - Show quoted text -
Hi,
thanks for the tip, but it didn't help.
I used:
sys.path.append('/path/Linux/rh_linux')
and the problem still persists:
Traceback (most recent call last):
File "shrink_bs_070226.py", line 26, in ?
from qt import *
File "/path/Linux/python/rh_linux/lib/python2.2/site-packages/
qt.py", line 46, in ?
import libsip
ImportError: libadamsqt.so: cannot open shared object file: No such
file or directory
Is there another possibility of how to solve it just by adding some
lines in script?
Thanks
Boris
More information about the Python-list
mailing list