Pyenv: pip: command not found

I am trying to get Python 2.7 to play well with pyenv and virtualenv on OSX El Capitan. I installed pyenv using Homebrew and then Python pyenv install 2.7.11 with pyenv install 2.7.11 . This describes the setup:

 $ which python /usr/local/bin/python $ which virtualenv /usr/local/bin/virtualenv $ head -1 /usr/local/bin/virtualenv #!/usr/local/bin/python $ which pip /Users/username/bin/pip $ head -1 /Users/robinedwards/bin/pip #!/usr/local/bin/python $ pyenv install --list | grep 2.7.11 2.7.11 

.bashrc contains the lines:

 export PYENV_ROOT="$HOME/.pyenv" export PATH="$PYENV_ROOT/bin:$PATH" eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)" 

Now when I try to create a new virtualenv project:

 $ pyenv virtualenv 2.7.11 newproject pyenv: pip: command not found 

Any idea what I'm doing wrong?

+9
source share
2 answers

You need to install pip separately if you did not install pyenv from the binaries provided by python.org

After installing the required python version, download and install pip :

 wget https://bootstrap.pypa.io/get-pip.py (sudo) python ./get-pip.py​ rm get-pip.py 

Ref: https://pip.pypa.io/en/stable/installing/

+3
source

I had the same error message. The problem was due to an unsuccessful installation of the Python version, so pip not found for this version. In fact, even python not found.

Example:

 pyenv install 3.7.2 # this failed, but I did not realize it failed at first pyenv versions | grep 3.7.2 

3.7.2

 pyenv local 3.7.2 python --version 

pyenv: python: command not found

So the problem was not pip itself, but the wrong installation of the Python version. Just make sure you succeed when installing the Python version with pyenv .

+1
source

All Articles