11

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 
1
  • 2
    have you tried python setup.py install --prefix=/home/dgomez Commented Feb 20, 2013 at 15:35

2 Answers 2

17

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

Sign up to request clarification or add additional context in comments.

3 Comments

Where do I add /home/dgomez/lib/python2.7/site-packages on the PYTHONPATH? I'm using linux. Do I have to create a file?
BTW, I don't have root access on this machine.
@amb1s1 Set PYTHONPATH in your .bashrc if you're using bash. Apart from that read up on Linux and environment variables.
1

@amb1s1

Environment variables are shortcuts that your system uses to give many programs the ability to find certain shared resources easily. In the Linux environments, these variables are set up for you when you log in to your terminal.

You can solve this problem by typing this code in terminal

export PYTHONPATH="/home/dgomez/lib/python2.7/site-packages"

For permanent fix, you can add these environment variables to “.bashrc” or “.bash_profile“ by just adding the above code in it. Everytime you open a new terminal or login remotely to server, these files are executed & hence all environment variables are made available then and there.

1 Comment

Only if your terminal is bash and you remove the spaces around the equals sign.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.