Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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 am using pip install on a mac to get my python requirements for a django website.

I got pip from MacPorts

port install pip-2.7

Now the problem is the pip installs the packages in a location which is not in my python sys.path.

I just copied this bogus location

/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/

to a location present in my sys.path

/Library/Python/2.7/

Of course this worked ok, but I will use pip in the future so I need a persistent solution.

The question is how can I alter my sys.path to recognize that crap location or how do I tell pip to install dependencies somewhere else ?

share|improve this question
    
Cross site duplicate, stackoverflow.com/q/10461590/425313 – Brad Koch Mar 18 '14 at 1:50
up vote 1 down vote accepted

Documentation: Set the PYTHONPATH environment variable.

share|improve this answer
    
I forgot to mention, but I have already tried that a few times. I set and export the $PYTHONPATH (which however I don't really understand why is empty). I open another terminal and and echo $PYTHONPATH prints the change. However, opening a python interpretor and printing sys.path seems unchanged. – Calin Paul Alexandru May 5 '12 at 12:52
    
Oh, nevermind. It finally worked. – Calin Paul Alexandru May 5 '12 at 12:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .