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