473,513 Members | 4,022 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2882
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
2944
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, then explain what happened (again, in blindingly obvious terms). There's extra credit for giving a design insight as to why things are as they are.
8
1528
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 object itself, right? because i know that in eiffel they give the programmer the 2 options, the second being implemented with an additional keyword...
8
3034
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 PyImport_Import("xyz"), Python returns an error "No module named xyz". The problem _seems_ to be that I had no PYTHONPATH variable defined (though python-shell works ok...
0
1337
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 to run my wiki/blog software, Leonardo under Python 2.4 on Windows 2000. I was able to reproduce the problem under Python 2.4 on Windows XP Pro but...
9
6101
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 can't get the environmental variables to stick because all of Pythons' system start/open functions split off into their own little subshells,...
14
3345
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 (fr_FR.iso885915), and my terminal (rxvt-unicode) is able to display those chars. What am I missing? Thanks.
9
2561
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: $ python -c "print '\033 ColorReset = os.environ Esc = os.environ print '%s%s%s%s%s' % (Esc, Color, " foo ", Esc, ColorReset)
4
7493
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 variable is not in the os.environ dictionary. I know that cron runs in a subshell that does not have all of the normally set environment variables. ...
0
3440
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 do not inherit this value. From "man bash": Shell Variables The following variables are set by the shell:
0
7270
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7397
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7563
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7125
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7543
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5703
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4757
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3252
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
470
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.