467,921 Members | 1,333 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,921 developers. It's quick & easy.

python CGI,sybase and environ variables

hi
i am writing a CGI to process some database transactions using the
Sybase module.
so in my CGI script, i have:

....
import Sybase
import cgitb; cgitb.enable(display=1 , logdir="/tmp/weblog.txt")
....
....

the problem is , everytime i have ImportError: No module named Sybase
flagged out.

at first i think it's library path misconfiguration, so i put
os.environ["SYBASE"] = '/path/to/sybase'
os.environ["LD_LIBRARY_PATH"] = '/path/to/sybase/lib'

before i import Sybase. but its still the same error

Ok.so now, is it necesary to configure the web server's "nobody" user's
profile to point to the Sybase libraries? or worse, configure root's
profile to point to Sybase libraries? what's could be wrong?
thanks for any help rendered.

Nov 2 '05 #1
  • viewed: 2584
Share:
2 Replies
i have solved the problem.
thanks.

Nov 2 '05 #2
ei***********@yahoo.com wrote:
hi
i am writing a CGI to process some database transactions using the
Sybase module.
so in my CGI script, i have:

...
import Sybase
import cgitb; cgitb.enable(display=1 , logdir="/tmp/weblog.txt")
...
...

the problem is , everytime i have ImportError: No module named Sybase
flagged out.

at first i think it's library path misconfiguration, so i put
os.environ["SYBASE"] = '/path/to/sybase'
os.environ["LD_LIBRARY_PATH"] = '/path/to/sybase/lib'

before i import Sybase. but its still the same error

Ok.so now, is it necesary to configure the web server's "nobody" user's
profile to point to the Sybase libraries? or worse, configure root's
profile to point to Sybase libraries? what's could be wrong?
thanks for any help rendered.

You should try adding "/path/to/sybase" to sys.path as well as/rather
than putting it in an environment variable. sys.path is what the
interpreter uses to find importable modules.

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/

Nov 2 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by Raymond Hettinger | last post: by
8 posts views Thread by Ali El Dada | last post: by
8 posts views Thread by Tero Pihlajakoski | last post: by
reply views Thread by jtauber | last post: by
9 posts views Thread by Jeff Groves | last post: by
14 posts views Thread by Fabrice DELENTE | last post: by
4 posts views Thread by Stephen Cattaneo | last post: by
reply views Thread by Cameron Simpson | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.