How can I use pip in a version of python installed by pyenv?

0

I installed version 3.6.0rc2 on pyenv and I really need pygame in this version. I tried to use sudo pip uninstall pygame and sudo pip install pygame and also tried sudo pip3 uninstall pygame and sudo pip3 install pygame . But pip and pip3 only install pygame in python3.5 and 2.7, but when I give pip -V it appears:

  

pip 9.0.1 from /home/rodrigo/.pyenv/versions/3.6.0rc2/lib/python3.6/site-packages (python 3.6)

Apparently all right but does not install anything in python 3.6.0.

And I do not want to install python 3.6 for anything other than pyenv.

    
asked by anonymous 20.12.2016 / 21:12

1 answer

0

The pip as well as the Python language is very specific with the versions. When the Python terminal is started, we have:

python
python2
python2.6
python2.7
python3
python3.4
python3.5
...

With pip is the same thing. Your pip3 by default must be set to Python3.5 , then use pip of Python3.6

sudo pip3.6 install pygame

Set path with /usr/local/ to su and sudo

Edit the / etc / profile file (use nano, vi, vim or joe).

Add the code in the last line of the file:

export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games/bin"

This path , already configures all the directories that have the binaries for all users, thus working both for login with su and sudo .

    
20.12.2016 / 23:14