473,288 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,288 software developers and data experts.

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
2 2854
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Raymond Hettinger | last post by:
Here are four more mini-mysteries for your amusement and edification. In this episode, the program output is not shown. Your goal is to predict the output and, if anything mysterious occurs,...
8
by: Ali El Dada | last post by:
hi all: in python, when a class, say Father, has a member that itself is an instance of another class, say Child, an instance of Father actually only has a reference to a Child, not the Child...
8
by: Tero Pihlajakoski | last post by:
Hi, I've been experimenting on embedding Python to a C software, and ran into a little problem with PYTHONPATH (I'm running on linux). Here's the deal: When trying to call...
0
by: jtauber | last post by:
Did something change between 2.3 and 2.4 that would affect os.environ being populated with CGI variables when using the BaseHTTPServer/CGIHTTPServer? I received a bug report from someone trying...
9
by: Jeff Groves | last post by:
I'm writing a launcher that should do the following: 1. Activate a .bat file to set environmental variables. 2. Start 3 programs, using said environmental variables as arguments. However, I...
14
by: Fabrice DELENTE | last post by:
Hello. I'm trying to display french characters (è -- that's e grave -- or à -- agrave) in python 2.5, with the ncurses wrapper that comes it, and I can't. My locale is set correctly...
9
by: TP | last post by:
Hi everybody, I am new to Python, I try to understand how Python treats special characters. For example, if I execute the following line in a shell console, I obtain a colored string: $...
4
by: Stephen Cattaneo | last post by:
Hello all, I am attempting to execute an automated test (written in Python) via cron. I have to check the HOSTNAME variable as part of the test, oddly under cron the HOSTNAME environment...
0
by: Cameron Simpson | last post by:
On 17Aug2008 21:25, John Nagle <nagle@animats.comwrote: Because $HOSTNAME is a bash specific variable, set by bash but NOT EXPORTED! Like $0 and a bunch of other "private" variables, subprocesses...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.