pyenv + anaconda + python3

I want to use python3. However, in Linux, python2 is used in various situations, and there is an inconvenience when python3 is defaulted system-wide. For example, it seems that the Dropbox client for linux is written in python2 series, and error messages occur frequently when using update-alternatives. Install pyenv and install and use anaconda on it (Reference).

git clone https://github.com/yyuu/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
source ~/.bashrc
pyenv install -l | grep ana #Search for the latest package
pyenv install anaconda3-4.3.1
pyenv rehash
pyenv global anaconda3-4.3.1
echo 'export PATH="$PYENV_ROOT/versions/anaconda3-4.3.1/bin/:$PATH"' >> ~/.bashrc
source ~/.bashrc
conda update conda

With this alone, you can create a root environment for the time being. Furthermore, it is possible to create a virtual environment that adjusts the dependency environment of the package. Basically, it seems better to create a virtual environment for work and develop it.

Create a virtual environment, install numpy, scipy, pandas, jupyter at the same time

conda create -n py3 python=3.4 numpy scipy pandas jupyter

Enter the virtual environment

source activate py3

Get out of the virtual environment

source deactivate

The package is installed in each environment (including root). Basically you can use conda install, but some packages are not in the conda repository. At this time, pip can also be used.

conda install numpy scipy
conda uninstall numpy
conda install -n py3 numpy scipy
conda uninstall -n py3 numpy
conda update numpy
conda update -n py3 numpy
pip install numpy

For example, to install Intel distribution for python

conda update conda
conda config --add channels intel
conda create -n idp intelpython3_core python=3
source activate idp
activate idp

Recommended Posts

pyenv + anaconda + python3
[Python] Anaconda, pyenv, virtualenv, .bash_profile
Python 3.3 in Anaconda
pyenv + virtualenv + Anaconda
Python environment construction (pyenv, anaconda, tensorflow)
Install python (pyenv, pyenv-virtualenv)
Install python with pyenv
Python version switching (pyenv)
Building an Anaconda environment for Python with pyenv
Python + Anaconda + Pycharm environment construction
python (pyenv + pyenv-virtualenv) + CentOS7 installation
Building a Python environment for pyenv, pyenv-virtualenv, Anaconda (Miniconda)
Python 2 series and 3 series (Anaconda edition)
Use Anaconda in pyenv environment
[CentOS7] Install anaconda using pyenv
Install Python environment with Anaconda
Python
Anaconda updated from 4.2.0 to 4.3.0 (python3.5 updated to python3.6)
Anaconda3 python environment construction procedure
Change python version using pyenv
Version upgrade of python Anaconda
homebrew, pyenv, anaconda, Jupyter Notebook
Reinstall python with pyenv with -fPIC
Install pyenv from Homebrew, install Python from pyenv
[Python] Django environment construction (pyenv + pyenv-virtualenv + Anaconda) for macOS
python with pyenv and venv
Python environment construction on Mac (pyenv, virtualenv, anaconda, ipython notebook)
How to install python using anaconda
Python memo Anaconda x Jupyter Notebook
Anaconda python environment construction on Windows 10
Anaconda and Python version correspondence table
Introducing Python using pyenv on Ubuntu 20.04
Install scrapy in python anaconda environment
Set python compile options with pyenv
Install Python 3.7 Anaconda on MAC, but Python 2
Python memo Anaconda installation (Mac only)
install tensorflow in anaconda + python3.5 environment
Python environment construction (pyenv + poetry + pipx)
Notes on installing Python using PyEnv
Unable to install Python with pyenv
Use Python in pyenv with NeoVim
Install Python on CentOS using Pyenv
Python import directory order (on anaconda)
Install Python on CentOS using pyenv
How to install Anaconda with pyenv
Python3.6 environment construction (using Win environment Anaconda)
[Python] Error and solution memo when using venv with pyenv + anaconda
Change the active version in Pyenv from anaconda to plain Python
[Pyenv] Building a python environment with ubuntu 16.04
kafka python
[Ubuntu 18.04] Python environment construction with pyenv + pipenv
Introduced anaconda
[Python] Building an environment with Anaconda [Mac]
Python basics ⑤
python + lottery 6
Python Summary
Built-in python
Python (anaconda) development environment construction procedure (SpringToolsSuites) _2020.4
Python technique
Studying python
Python 2.7 Countdown