Fixed...
All I did was change #!/usr/bin/python to #!/usr/local/bin/python
The page loaded right up it was loading Python ver 2.4.1 rather
than 2.4.2 where the MySQL db module was installed...
I knew it would be something easy... I learned something so it was
worth it...
--
http://mail.pyt
I have discovered the possible problem (I can't check this until later
when I am home)
I think when I upgraded to Python 2.4.2 it created my problem.
Below is what is going on:
Default Slackware 10.2 install - 2.4.1 installed into
/usr/lib/python2.4
Python 2.4.1 upgraded to 2.4.2
Upgrade downloa
Magnus Lycka wrote:
> Fred wrote:
> > Slackware Linux 10.2
>
> Heh, Slackware was my first Linux distro. Version
> 2.2 I think. 1993 maybe?
I have been using Slackware since 1995, version 3.0 kernel 1.2.13
> Some suggestions:
> Finally, the cgitb module is pretty useful. I
> suggest that you loo
Fred wrote:
> Slackware Linux 10.2
Heh, Slackware was my first Linux distro. Version
2.2 I think. 1993 maybe?
> Everything worked great up to this error when trying to load the
> webpage:
> "ImportError: No module name MySQLdb"
Some suggestions:
Start python interactively and try "import MySQLd
Fred wrote:
> Here is the complete error from my Apache error log:
>
> Traceback (most recent call last):
> File "/var/www/cgi-bin/mysqld_script_test.py", line 7, in ?
> import MySQLdb
> ImportError: No module named MySQLdb
> [Thu Jan 26 07:25:16 2006] [error] [client 127.0.0.1] malformed he
>From what I can tell everything seems right. Here are the results of
the sys.path:
>>> print sys.path
['', '/usr/local/lib/python24.zip', '/usr/local/lib/python2.4',
'/usr/local/lib/python2.4/plat-linux2',
'/usr/local/lib/python2.4/lib-tk',
'/usr/local/lib/python2.4/lib-dynload',
'/usr/local/lib/
Here is the complete error from my Apache error log:
Traceback (most recent call last):
File "/var/www/cgi-bin/mysqld_script_test.py", line 7, in ?
import MySQLdb
ImportError: No module named MySQLdb
[Thu Jan 26 07:25:16 2006] [error] [client 127.0.0.1] malformed header
from script. Bad head
This is the result of print sys.path:
>>> print sys.path
['', '/usr/local/lib/python24.zip', '/usr/local/lib/python2.4',
'/usr/local/lib/python2.4/plat-linux2',
'/usr/local/lib/python2.4/lib-tk',
'/usr/local/lib/python2.4/lib-dynload',
'/usr/local/lib/python2.4/site-packages']
MySQLdb lives here
Re-reading my message I noticed a stupid error, not effecting my
problem but annoying, I assigned variables and then did not use them,
then included import cgi for my regular script. This is how the command
line script should look:
#!/usr/bin/python
import MySQLdb
db=MySQLdb.connect(host = '192.
Fred wrote:
> I hope someone can help me with the below problem...
>
> Thanks,
> Fred
>
> My enviroment:
> --
> Slackware Linux 10.2
> Python 2.4.2
> MySql version 4.1.14
> MySql-Python 1.2.0
>
> What I am trying to do:
> ---
> Using MySQL, Python,
Fred wrote:
> I hope someone can help me with the below problem...
>
> Thanks,
> Fred
>
> My enviroment:
> --
> Slackware Linux 10.2
> Python 2.4.2
> MySql version 4.1.14
> MySql-Python 1.2.0
>
> What I am trying to do:
> ---
> Using MySQL, Python,
11 matches
Mail list logo