python CGI,sybase and environ variables

E

eight02645999

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.
 
S

Steve Holden

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
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top