** This article is for people who want to use Anaconda on mac. It may not be suitable for those who just want to install Python for study. We recommend that you consider whether you really need pyenv by referring to the article below. ** **
-Flowchart whether pyenv is required --Qiita -Python development environment for macOS using venv 2016
Please install the latest version of homebrew in advance.
Install pyenv
brew install pyenv
Add the following (make the completion of various commands of pyenv effective)
```:.bash_profile
#For pyenv
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
```
Install anaconda Checking the installable packages
pyenv install -l
Available versions:
2.1.3
2.2.3
(Abbreviation)
anaconda3-4.4.0
anaconda3-5.0.0
anaconda3-5.0.1
anaconda3-5.1.0
ironpython-dev
ironpython-2
(Abbreviation)
Install the latest anaconda3-5.1.0 at the moment (August 28, 2018).
```
pyenv install anaconda3-5.1.0
#If you change the global python, it will affect something else, so use it locally
pyenv local anaconda3-5.1.0
```
Create a virtual environment
#Below is python3.Build a 5-based anaconda environment
conda create -n py35 python=3.5 anaconda
conda info -e #Verification
Enable virtual environment
#This time activate solves the batting problem with pyenv.
conda activate py35
Disable virtual environment
#Deactivate when you finish using
conda deactivate
Delete when no longer needed
conda remove -n py35 --all
Recommended Posts