[PYTHON] pyenv notes

Install pyenv

How to install pyenv:

$ brew install pyenv

Add the following to .bashrc

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

Also have the Virtualenv plugin installed:

$ brew install pyenv-virtualenv

Check version

List of installable versions

$ pyenv install --list
Available versions:
  2.1.3
  2.2.3
  2.3.7
  2.4
  ...

You can install not only standard Python but also anaconda and pypy.

List of installed versions

$ pyenv versions
  system
  2.7.13
  3.6.1
* anaconda2-4.3.1 (set by /Users/yassu/.pyenv/version)
* anaconda3-4.3.1 (set by /Users/yassu/.pyenv/version)

At first there should be only system and system should be checked.

New Python installation

pyenv install {version}

This {version} is the version you can get with pyenv install --list.

For example, the latest version of python is 3.6.1, so to install it

$ pyenv install 3.6.1

Environment settings

To change the version of a global, python command

$ pyenv global {version1} [version2]

If you do not specify version2, the version is always fixed at` {version1}'.

If you specify version2, the python command uses {version1}. The python {n} command uses the corresponding version.

For example, if you say pyenv global 3.6.1 2.7.13, the python command will version 3.6.1 is used, but version 2.7.13 can be used with the python2 command.

To specify the python version under any directory, go to that directory and then

$ pyenv local {version}

You can also use two versions as well as pyenv global.

Temporarily specify the version:

$ pyenv shell {version}

Creating an environment

$ pyenv local {base-version} {version}

So, copy {base-version} and duplicate {version}.

Recommended Posts

pyenv notes
pyenv installation notes
Notes on pyenv and Atom
JetBrains_Learning Notes_003
pyenv note
system-wide pyenv
pyenv memo
SQL notes
Pandas notes
Sphinx notes
django notes
pyenv summary
Notes on installing Python using PyEnv
Jupyter_Learning Notes_000
(Beginner) Notes on using pyenv on Mac
Django notes
Notes on building Python and pyenv on Mac
pandas self-study notes
Python scraping notes
Mecab installation notes
Python study notes _000
concurrent.futures Usage notes
Theano installation notes
Jupyter study notes_006
Notes about with
Python beginner notes
Theano's basic notes
Python study notes_006
Linux study notes
Notes on Flask
Django's order_by notes
pyenv + virtualenv + Anaconda
Django Template notes
python C ++ notes
pyenv for linux
Python study notes _005
Python grammar notes
Python Library notes
pyenv + anaconda + python3
Hydrogen installation notes
Jupyter study notes_008
python personal notes
pyenv cheat sheet
Jupyter study notes_004
Notes about pytorch
Jupyter study notes_001
pyenv + pyenv-virtualenv (CentOS7)
python pandas notes
[Django] JWT notes
Python study notes_001
python learning notes
Python3.4 installation notes
Cabocha installation notes