Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PIP install and Python path

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 ?

like image 815
Calin Paul Alexandru Avatar asked May 05 '12 11:05

Calin Paul Alexandru


People also ask

Does pip install add to PATH?

The Pip Install is Not in the System Variable For Python commands to run from a Windows Command Prompt, the path of your pip install will need to be added to your PATH system variable. It should be added automatically if you installed Python via the installation file.


1 Answers

After a few attempts, setting the PYTHONPATH environmental var worked.

Best way to achieve this is to add the following to the ~/.bash_profile:

export PYTHONPATH=<bogus path here>

Don't forget to open a new terminal after changing.

like image 75
Calin Paul Alexandru Avatar answered Nov 13 '22 05:11

Calin Paul Alexandru