Installing Setuptools with root - Getting a PythonPath error

amb1s1 picture amb1s1 · Feb 20, 2013 · Viewed 19.1k times · Source

I already did the virtual python enviroment. When I'm trying to install setuptools I get the following:

 python setup.py install --prefix=/home/dgomez/

Error:

TEST FAILED: /home/dgomez//lib/python2.7/site-packages/ does NOT support .pth files
error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from.  The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

        /home/dgomez//lib/python2.7/site-packages/

and your PYTHONPATH environment variable currently contains:

    ''

When I check the system path, I received the following output:

>>> import sys
>>> import sys

/usr/lib/python27.zip
/usr/lib64/python2.7
/usr/lib64/python2.7/plat-linux2
/usr/lib64/python2.7/lib-tk
/usr/lib64/python2.7/lib-old
/usr/lib64/python2.7/lib-dynload
/usr/lib64/python2.7/site-packages
/usr/local/lib64/python2.7/site-packages
/usr/local/lib/python2.7/site-packages
/usr/lib64/python2.7/site-packages/gst-0.10
/usr/lib64/python2.7/site-packages/gtk-2.0
/usr/lib/python2.7/site-packages

How can I fix this issue?

UPDATE

I fix this issue by edit the .bashrc and I add the following line:

PYTHONPATH="${PYTHONPATH}:/home/dgomez/lib/python2.7/site-packages/"
export PYTHONPATH 

Answer

aknuds1 picture aknuds1 · Feb 20, 2013

Try putting /home/dgomez/lib/python2.7/site-packages in your PYTHONPATH environment variable.