[PYTHON] Ubuntu 16.04 LTS, beginner memorandum of environment construction to switch anaconda version with pyenv

I decided to make a note of the environment construction of pyenv so that I can forget it later.

environment

-Ubuntu 16.04

pyenv installation work

The following was implemented according to the reference URL.

$ sudo apt install git
$ git clone https://github.com/yyuu/pyenv.git ~/.pyenv
$ git clone https://github.com/yyuu/pyenv-pip-rehash.git ~/.pyenv/plugins/pyenv-pip-rehash

【~/.Added to bashrc]
 export PYENV_ROOT=$HOME/.pyenv
 export PATH=$PYENV_ROOT/bin:$PATH
 eval "$(pyenv init -)"

Install anaconda from pyenv

$ pyenv install --list | grep anaconda

Check the version of anaconda. When the version has not been updated I did the following to reflect the changes in my local repository.

$ cd $(pyenv root)
$ git pull

After checking the version, install as follows.

$ pyenv install anaconda2-4.1.1
$ pyenv install anaconda3-4.1.1

Switch versions with pyenv

$ pyenv global anaconda2-4.1.1
$ python --version
  Python 2.7.12 :: Anaconda 4.1.1 (64-bit)
$ pyenv global anaconda3-4.1.1
$ python --version
  pyenv global anaconda3-4.1.1

It seems that it is switching.

pyenv version check

$ pyenv versions
  system
  anaconda2-4.1.1
* anaconda3-4.1.1 (set by /home/hogehoge/.pyenv/version)

So, I was able to confirm that it seemed to be switching.

pyenv own version upgrade work

$ git clone git://github.com/yyuu/pyenv-update.git ~/.pyenv/plugins/pyenv-update
$ pyenv update

URL that I used as a reference

http://keisanbutsuriya.hateblo.jp/entry/2015/03/21/183323

-Installing the pyenv-pip-rehash plugin

http://qiita.com/Kodaira_/items/feadfef9add468e3a85b

-Execute git clone.

http://qiita.com/MasayaHayashi724/items/5096bf19fca347b4e56a

-Run pyenv versions.

http://qiita.com/SUZUKI_Masaya/items/7ba3fef9eb7c9603762a

・ I wonder if it was better to use anyenv. .. ..

Recommended Posts

Ubuntu 16.04 LTS, beginner memorandum of environment construction to switch anaconda version with pyenv
[Ubuntu 18.04] Python environment construction with pyenv + pipenv
Vue.js + Flask environment construction memorandum ~ with Anaconda3 ~
[0] TensorFlow-GPU environment construction built with Anaconda on Ubuntu
From Python environment construction to virtual environment construction with anaconda
I tried to build an environment of Ubuntu 20.04 LTS + ROS2 with Raspberry Pi 4
[Django] Memorandum of environment construction procedure
Python environment construction (pyenv, anaconda, tensorflow)
Environment construction memo of pyenv + conda
From Ubuntu 20.04 introduction to environment construction
Environment construction of "Tello_Video" on Ubuntu
How to install Anaconda with pyenv
Environment construction with pyenv and pyenv-virtualenv
Environment construction of TensorFlow + JupyterNotebook + Matplotlib on Windows version Anaconda (August 2017 version)
[Pyenv] Building a python environment with ubuntu 16.04
Change Python 64bit environment to 32bit environment with Anaconda
How to use OpenVPN with Ubuntu 18.04.3 LTS
Steps to build a Django environment with Win10 WSL Ubuntu18.04 + Anaconda + Apache2
Notes from installing Homebrew to building an Anaconda environment for Python with pyenv
Call anaconda virtual environment from ubuntu terminal memorandum
MacOS 10.11 environment construction: Powerline with Anaconda and Dein.vim
Build python environment with pyenv on EC2 (ubuntu)
Python environment construction (Anaconda + VSCode) @ Windows10 [January 2020 version]
Building an Anaconda environment for Python with pyenv
Use multiple versions of python environment with pyenv
[Memo] Build a virtual environment with Pyenv + anaconda
Poetry-virtualenv environment construction with python of centos-sclo-rh ~ Notes
Flow of creating a virtual environment with Anaconda
Python 3.x environment construction by Pyenv (CentOS, Ubuntu)
How to get started with Visual Studio Online ~ The end of the environment construction era ~
Memo A beginner tried to build a Java environment and Japaneseize it on Ubuntu 18.04.2 LTS.
Install the latest version of CMake on Ubuntu 18.04.4 LTS
The story of sharing the pyenv environment with multiple users
Create a virtual environment with Anaconda installed via Pyenv
From Kafka to KSQL --Easy environment construction with docker
Check when the version does not switch with pyenv
Environment construction with anyenv + pyenv (migrate from pyenv only (Mac))
[Python] Django environment construction (pyenv + pyenv-virtualenv + Anaconda) for macOS
Memorandum of understanding for environment construction of AutoML library PyCaret
Example of pytest environment to fix database with Docker
Ssh to virtual environment with remote development of vscode
How to quickly create a machine learning environment using Jupyter Notebook with UbuntuServer 16.04 LTS with anaconda
pyenv + fish environment construction
Anaconda environment construction memo
Switch the setting value of setting.py according to the development environment
I want to specify another version of Python with pyvenv
Double-click ipynb in windows + anaconda environment to open with jupyter-notebook
From environment construction to deployment for flask + Heroku with Docker
How to display a list of installable versions with pyenv
Memo to switch between python2 series and 3 series in anaconda environment of mac (win is also added)