Menu

#315 MySQLdb requires(?) setuptools at runtime

MySQLdb-1.3
open
MySQLdb (285)
5
2014-08-25
2011-08-02
BryanP
No

MySQLdb (1.2.3) apparently requires setuptools not just during installation, but also at runtime.

I am working with MySQLdb on a parallel cluster where all of the software packages must be loaded through a module system before use. Not everyone is using mysql so mysql-python is setup in its own module, as is setuptools. (Note: I am just a user not an admin). When I attempt to import MySQLdb without previously loading setuptools I get the following:

$ module load python/2.7.2
$ module load mysql-python/1.2.3
$ python
Python 2.7.2 (default, Jul 6 2011, 14:29:55)
[GCC 4.5.1 20100924 (Red Hat 4.5.1-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.linux-x86_64/egg/MySQLdb/init.py", line 19, in <module>
File "build/bdist.linux-x86_64/egg/_mysql.py", line 7, in <module>
File "build/bdist.linux-x86_64/egg/_mysql.py", line 3, in bootstrap
ImportError: No module named pkg_resources
import _mysql
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.linux-x86_64/egg/_mysql.py", line 7, in <module>
File "build/bdist.linux-x86_64/egg/_mysql.py", line 3, in bootstrap
ImportError: No module named pkg_resources

However, if I pre-load setuptools things work with no problem:

$ module load python/2.7.2
$ module load setuptools/0.6c11
$ module load mysql-python/1.2.3
$ python
Python 2.7.2 (default, Jul 6 2011, 14:29:55)
[GCC 4.5.1 20100924 (Red Hat 4.5.1-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import MySQLdb

Version information:
mysql-python 1.3.2
python 2.7.2
Fedora r14
setuptools 0.6c11

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.