Since python can be easily installed by using anaconda, the procedure is described. By creating a virtual environment with anaconda, it is possible to use multiple environments such as python2 and python3.
CentOS 6.8
Bring pyenv from git.
$ 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 anaconda
anaconda2-x.x.x is python2 series, anaconda3-x.x.x is compatible with python3 series.
This time, install the latest version of anaconda2-4.0.0 on July 3, 2016 on pyhon2 series.
$ pyenv install anaconda2-4.0.0
$ pyenv rehash
$ pyenv global anaconda2-4.0.0
$ conda update conda
To build a new virtual environment, execute the following command.
conda create -n
In particular,
$ conda create -n test1 python=2.7 numpy matplotlib scipy pandas jupyter
And. If you want to use the pyhon3 system environment, install anaconda3 by the same procedure and install anaconda3. Just create an environment with conda
$ conda env list
Or
$ conda info -e
To apply the environment name test1, execute the following command
$ source PYENV_ROOT/versions/anaconda2-4.0.0/bin/activate test1
If you exit,
$ source deactivate
that's all
Recommended Posts