Baseball Musings
Baseball Musings
November 27, 2006
Technical Bleg

Ever since a disk crash last week, the Day by Day Database is not working. The problem is that when my Python scripts run, they can import the module MySQLdb. However, if I run interactively from the interpreter, I can import the module just fine. There is some difference in importing the module when I'm running a cgi-script vs. python nameofprogram.

It's running on a linux server (Apache) and the python version is 2.4.3. I'm stumped and the service provider is stumped. Any assistance would be greatly appreciated.


Posted by David Pinto at 03:12 PM | Blogs | TrackBack (0)
Comments

Your web process likely has a different environment than your interactive shell. The web environment is likely missing a relevant environment variable or path entry.

Posted by: YumYum at November 27, 2006 03:59 PM

Try turning it off then on again:)

Posted by: bar35 at November 27, 2006 04:45 PM

bar35 gots it right.

Posted by: Sports Dude at November 27, 2006 05:29 PM

I don't know Python, but one thing I have noticed is that the db connect strings have changed over time; if the DB is actually on the same server, you might take a look at the connect environment vars.

Posted by: Rob McMillin at November 27, 2006 08:31 PM

So were any of the above correct?

Posted by: RubberNecker at November 28, 2006 01:18 AM

No. The provider installed a new version of Python, but I was pointing at the old one.

Posted by: David Pinto at November 28, 2006 07:51 AM
Post a comment









Remember personal info?