** Homebrew **: "One of the package management systems that simplifies software deployment on the Mac OS X operating system" by wikipedia PS: Homebrew officially supports running on Linux and Windows (WSL) environments in addition to macOS.
** pyenv **: A tool for managing different versions of Python. By introducing it, it becomes easy to switch between multiple versions such as Python v2 series and v3 series.
** Anaconda **: A package that includes a set of libraries that can be used for scientific calculations and data analysis in addition to Python itself.
Anaconda is a free collection of powerful packages for Python that enables large-scale data management, analysis, and visualization for Business Intelligence, Scientific Analysis, Engineering, Machine Learning, and more.
Mac OSX 10.11.3 (my environment) Confirmed on Mac OSX 10.14
Since macOS 10.15 Catalina, the default shell has been changed from bash to zsh, so if you are newly installing with Catalina, please write the part of 4.pyenv installation
to .zshrc.
Added on May 24, 2020 I also confirmed the operation in my Windows 10 WSL2 (Ubuntu) environment.
Enter the command as it is on the terminal. Each command after "\ $" is one command. You do not need to enter the "\ $" mark.
Terminal
$ brew --version
Those who say Homebrew 1.7.6 etc. are already installed, so go to 3.
Those who do not have Homebrew installed
Terminal
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Terminal
$ brew update --force && brew upgrade
・ If you are using bash
Terminal
$ brew install pyenv
$ echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
$ exec $SHELL -l
$ echo 'eval "$(pyenv init -)"' >> ~/.zshrc
Please.$ pyenv install -l
.
Check there for the latest version of anaconda.Terminal
$ pyenv install anaconda3-2019.10
$ pyenv global anaconda3-2019.10
Terminal
$ pyenv install anaconda-4.0.0
$ pyenv global anaconda-4.0.0
pyenv global
ensures that all directories run the corresponding Python version. If you want to use the corresponding version only in a specific directory, use pyenv local anaconda3-2019.10
.
Terminal
$ python
Python 3.7.4 (default, Aug 13 2019, 15:17:50)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
If you type python
and the above appears, the installation is successful. (For v.3 series)
Exit Python's interactive shell by pressing Ctrl + D
(or typingquit ()
).
Terminal
$ pyenv versions
You can check the version of python installed by pyenv with.
Terminal
$ pyenv global anaconda3-4.0.0
You can specify to use python 3 (anaconda3-4.0.0 in this case) like this. You can switch to another version in the same way.
Also, installing a new Anaconda or Python version
Terminal
$ pyenv install -l
Display a list of python versions that can be installed with
Terminal
$pyenv install feh
You can install the version specified in.
If you have any questions or mistakes, please comment.
Linux version: Memo for building Python Anaconda environment with pyenv in Linux environment