Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I don't have root access to a machine (Linux), but I would like to install the MySQLdb module (or any other MySQL module) for python.

I have tried my usual approach (python install --user) but it appears the flag is not implemented

Running with the --home=~ flag gives the following

running install
Checking .pth file support in /user/alperin/lib64/python/
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the installation directory:

[Errno 2] No such file or directory: '/user/alperin/lib64/python/test-easy-install-11328.pth'

The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was:


This directory does not currently exist.  Please create it and try again, or choose a different installation directory (using the -d or --install-dir option).

easy install MySQLdb gives the same errors (with the same parameters).

What am I missing?

share|improve this question
Use virtualenv or make sure the directory is on the relevant paths before you try to install it there. – Jan 28 '12 at 5:46
that worked. Though I am now running into another error (because I have MySql compiled and installed in my home dir): _mysql.c:36:23: error: my_config.h: No such file or directory – pocketfullofcheese Jan 29 '12 at 3:34
You shouldn't really compile your own mysql unless you're very sure about all the parameters to configure. What I suggest you do is to get the mysql package for the linux distribution and manually install it. – Jan 29 '12 at 4:02
will I be able to install it my home dir? – pocketfullofcheese Jan 29 '12 at 4:07
Yes. Many stuff that goes into a system dir (/bin, /lib, /usr) can be installed in any other directory if you specify that directory in the correct environment variable (PATH, LIBPATH, PYTHONPATH, etc.). I think there are even command line options to install packages in another location directly. – Jan 30 '12 at 2:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.