A version control tool for python. It is convenient because you can switch between multiple versions.
It is the same as rbenv of phpenv.ruby in PHP.
install
Installed using homebrew.
$ brew install pyenv
...
...
There are various
...
...
$ pyenv --version
pyenv 20151006
Let's check the list of Python versions that can be installed with pyenv.
$ pyenv install --list
Available versions:
2.1.3
2.2.3
2.3.7
2.4
2.4.1
2.4.2
2.4.3
2.4.4
2.4.5
2.4.6
...
Omission...
...
For the time being, I will put in the 2nd and 3rd series.
To install, just specify the version as pyenv install x.x.x
as shown in ↓.
$ pyenv install 2.7.9
...
Omission
...
Installed Python-2.7.9 to /Users/riki/.pyenv/versions/2.7.9
$ pyenv install 3.5.0
...
Omission
...
Installed Python-3.5.0 to /Users/riki/.pyenv/versions/3.5.0
As a test, let's see which version it is now.
$ python --version
2.7.10
This is the default version. It is necessary to specify the version installed by pyenv properly.
#Check the available version
$ pyenv versions
* system (set by /Users/riki/.python-version)
2.7.9
3.5.0
#Specify the version to use
$ pyenv local 3.5.0
$ pyenv rehash
$ python --version
Python 3.5.0
You can now use 3.5.0
.
Recommended Posts