I was trying to get 0.9.0c2 working last night on a RH7.1 box with mod_python and got an error importing _mysql through MySQLdb. The error was init failed. I could load the module fine from a test program running from the shell, but not from mod_python.
Relavent info:
RH7.1
MySQL 3.23.36-1
Python 2.0 without threads
mod_python 2.7.2
I think it might be the from exceptions import Exception, StandardError in _mysql_exceptions.py file.
Anyone else seeing this problem?
....maki....
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Almost always if the init fails on importing _mysql, it's because _mysql couldn't find _mysql_exceptions.py. This should be installed in the same place as _mysql.so. Could mod_python be playing with sys.path?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was having the same problem (init failed in _mysql) while using mod_snake. It works fine now that I've downgraded to 0.3.5
The _mysql_exceptions.py file was in the same directory (/usr/lib/python2.0/site-packages) as _mysql.so, and with sensible permissions (i.e. world readable)
sys.path looked fine and it certainly worked OK from the interpreter.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Something to try as a workaround: Try importing _mysql_exceptions prior to importing MySQLdb. This will ensure the module is actually loaded prior to importing _mysql (which imports _mysql_exceptions) during it's initialization), so it will already be in sys.modules and it will not have to search along sys.path. Normally there is no reason to do this, but perhaps something weird is happening in mod_snake.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was trying to get 0.9.0c2 working last night on a RH7.1 box with mod_python and got an error importing _mysql through MySQLdb. The error was init failed. I could load the module fine from a test program running from the shell, but not from mod_python.
Relavent info:
RH7.1
MySQL 3.23.36-1
Python 2.0 without threads
mod_python 2.7.2
I think it might be the from exceptions import Exception, StandardError in _mysql_exceptions.py file.
Anyone else seeing this problem?
....maki....
Almost always if the init fails on importing _mysql, it's because _mysql couldn't find _mysql_exceptions.py. This should be installed in the same place as _mysql.so. Could mod_python be playing with sys.path?
I was having the same problem (init failed in _mysql) while using mod_snake. It works fine now that I've downgraded to 0.3.5
The _mysql_exceptions.py file was in the same directory (/usr/lib/python2.0/site-packages) as _mysql.so, and with sensible permissions (i.e. world readable)
sys.path looked fine and it certainly worked OK from the interpreter.
Something to try as a workaround: Try importing _mysql_exceptions prior to importing MySQLdb. This will ensure the module is actually loaded prior to importing _mysql (which imports _mysql_exceptions) during it's initialization), so it will already be in sys.modules and it will not have to search along sys.path. Normally there is no reason to do this, but perhaps something weird is happening in mod_snake.