2

I'm trying to install pip for python and cannot seem to figure out how to make the scripts subdirectory of my python installation available on the system path. (I've already installed pip with easy_install)

According to the pip site this isn't done automatically:

"To enable the use of pip from the command line, ensure the Scripts subdirectory of your Python installation is available on the system PATH. (This is not done automatically.)"

I haven't found any straightforward tutorials on how to modify this.

iliketolearn
  • 670
  • 3
  • 8
  • 25
  • Possible duplicate of [Easy\_install and Pip doesn't work](http://stackoverflow.com/questions/7110360/easy-install-and-pip-doesnt-work) – jww Oct 10 '14 at 05:07

2 Answers2

2

First you need to find the path to your python installation, you can do this by typing this:

which python

In that directory there should be a directory called Scripts

You can then add the full path of this directory to PATH by typing

export PATH=$PATH:"<insert_path_here>"

So for example mine was:

export PATH=$PATH:"/cygdrive/c/Python27/Scripts"

You are only appending the new path to PATH, not replacing the old one. Be very careful to add the $PATH: after the equals. This is what keeps the old PATH intact. The : is the path separator.

Katy Montgomerie
  • 436
  • 4
  • 11
  • Sorry to reawaken this question after-the-fact. This will not permanently change the path to pip, however. Which means that every time I exit the terminal, the path gets deleted. So, how do I keep this system path saved permanently so that the terminal always recognizes 'pip'? I am using cygwin btw. thanks. – makansij Jul 22 '14 at 19:16
  • I don't know if there is a better way, but could you just put the above command in your `.bashrc` file? This file is sourced every time you start up. – Katy Montgomerie Jul 28 '14 at 15:24
0

For those of you you come here later, if you are working with Python 3.4, the Scripts sub-directory won't exist. According to this site, pip is installed by default with 3.4:

Changed in version 3.4: Installs pip by default, added the --without-pip and --copies options

I understand the question is about 2.7, but I happened upon this trying to add the Scripts directory to my PATH, but then found out that there is no need to do this. I apologize if any of this is misinformation.

t-r0d
  • 21
  • 5