I am trying to install MySQLdb package. I found the source code here.
I did the following:
gunzip MySQL-python-1.2.3c1.tar.gz
tar xvf MySQL-python-1.2.3c1.tar
cd MySQL-python-1.2.3c1
python setup.py build
As the result I got the following:
Traceback (most recent call last):
File "setup.py", line 5, in ?
from setuptools import setup, Extension
ImportError: No module named setuptools
Does anybody knows how to solve this problem?
By the way, if I am able to do the described step, I will need to do the following:
sudo python setup.py install
And I have no system-administrator-rights. Do I still have a chance to install MySQLdb?
Thank you.
If MySQLdb’s now distributed in a way that requires
setuptools, your choices are either to download the latter (e.g. from here) or refactor MySQLdb’s setup.py to bypasssetuptools(maybe just importingsetupandExtensionfrom plaindistutilsinstead might work, but you may also need to edit some of thesetup_*.pyfiles in the same directory).Depending on how your site’s Python installation is configured, installing extensions for your own individual use without requiring sysadm rights may be hard, but it’s never truly impossible if you have shell access. You’ll need to tweak your Python’s sys.path to start with a directory of your own that’s your personal equivalent of the system-wide site pacages directory, e.g. by setting
PYTHONPATHpersistently in your own environment, and then manually place in said personal directory what normal installs would normally place in site-packages (and/or subdirectories thereof).