-
Notifications
You must be signed in to change notification settings - Fork 161
Install Python via pyenv
Joongi Kim edited this page Dec 29, 2017
·
13 revisions
We highly recommend pyenv to install multiple Python versions side-by-side, which does not interfere with system-default Pythons.
NOTE: Change ~/.profile
accroding to your shell and system configuration if needed.
$ git clone https://github.com/pyenv/pyenv.git ~/.pyenv
...
$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile
$ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile
$ echo 'eval "$(pyenv init -)"' >> ~/.profile
$ exec $SHELL -l
$ pyenv # check installation
pyenv 1.2.0-6-g9619e6b
Usage: pyenv <command> [<args>]
Some useful pyenv commands are:
...
$ git clone https://github.com/pyenv/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv
...
$ echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.profile
$ exec $SHELL -l
$ pyenv virtualenv # check installation
pyenv-virtualenv: no virtualenv name given.
Install Python3 latest version.
$ pyenv install 3.6.4
Change "myvenv" to specific names required in other guide pages.
$ pyenv virtualenv 3.6.4 myvenv
$ pyenv shell myvenv