Notes from installing Homebrew to building an Anaconda environment for Python with pyenv

** 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.

environment

Mac OSX 10.11.3 (my environment) Confirmed on Mac OSX 10.14

Note

Enter the command as it is on the terminal. Each command after "\ $" is one command. You do not need to enter the "\ $" mark.

1. Check if Homebrew is installed

Terminal


$ brew --version  

Those who say Homebrew 1.7.6 etc. are already installed, so go to 3.

2. Install Homebrew

Those who do not have Homebrew installed

Terminal


$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

3. Homebrew environment update

Terminal


$ brew update --force && brew upgrade

4. Install pyenv

・ If you are using bash

Terminal


$ brew install pyenv
$ echo 'eval "$(pyenv init -)"' >> ~/.bash_profile

$ exec $SHELL -l

5. Install Python (Anaconda)

Those who want to use Python version 3 series

Terminal


$ pyenv install anaconda3-2019.10
$ pyenv global anaconda3-2019.10

Those who want to use Python version 2 series

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.

6. Confirmation

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 ()).

7. Switching Python version (How to use pyenv)

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

Recommended Posts

Notes from installing Homebrew to building an Anaconda environment for Python with pyenv
Building an Anaconda environment for Python with pyenv
[Python] Building an environment with Anaconda [Mac]
From Python environment construction to virtual environment construction with anaconda
Building a Python environment for pyenv, pyenv-virtualenv, Anaconda (Miniconda)
Building an environment for natural language processing with Python
[Pyenv] Building a python environment with ubuntu 16.04
Change Python 64bit environment to 32bit environment with Anaconda
From building a Python environment for inexperienced people to Hello world
From installing Ansible to building a Python environment in Vagrant's virtual environment
Building a Python development environment on Windows -From installing Anaconda to linking Atom and Jupyter Notebook-
For beginners to build an Anaconda environment. (Memo)
Building an environment for executing Python scripts (for mac)
Building a Python environment with WLS2 + Anaconda + PyCharm
I wanted to install Python 3.4.3 with Homebrew + pyenv
Various commands for building an environment with Apache
Introduction to Python "Re" 1 Building an execution environment
Try building an environment for MayaPython with VisualStudioCode
Procedure from uninstalling pyenv to installing again (anaconda)
Build an environment to execute C ++ functions from Python with Pybind11 (for Windows & Visual Studio Code people)
How to build an environment when you want to use python2.7 after installing Anaconda3
Building an environment to comply with the Python coding standard (PEP8) with Eclipse + PyDev
What to do if you get an error when installing python with pyenv
From setting up Raspberry Pi to installing Python environment
Use Python installed with pyenv for PL / Python execution environment
[Python] Django environment construction (pyenv + pyenv-virtualenv + Anaconda) for macOS
Install the latest Python from pyenv installed with homebrew
Building an environment to use CaboCha with google colaboratory
[Python] Building an environment for competitive programming with Atom (input () can be used!) [Mac]
Install Python environment with Anaconda
What to do if you get an OpenSSL error when installing Python 2 with pyenv
Anaconda updated from 4.2.0 to 4.3.0 (python3.5 updated to python3.6)
Install pyenv from Homebrew, install Python from pyenv
I tried to build an environment for machine learning with Python (Mac OS X)
Update Python for Raspberry Pi to 3.7 or later with pyenv
Let's get started with Python ~ Building an environment on Windows 10 ~
Summary from building Python 3.4. * From source to building a scientific computing environment
Create an environment for "Deep Learning from scratch" with Docker
From environment construction to deployment for flask + Heroku with Docker
Introduction to Python for VBA users-Calling Python from Excel with xlwings-
How to run an app built with Python + py2app built with Anaconda
Building an environment to execute python programs on AWS EC2
Notes on deploying pyenv with Homebrew and managing Python versions
I created an environment for Masonite, a Python web framework similar to Laravel, with Docker!
[Sakura Rental Server] (For beginners) How to build an environment for Python, pyenv, and Flask. | For csh
Setup modern Python environment with Homebrew
Create folders from '01' to '12' with python
Python environment construction (pyenv, anaconda, tensorflow)
Building a virtual environment with Python 3
Notes on installing Python using PyEnv
Unable to install Python with pyenv
Created an environment for Anaconda & Jupyter
An introduction to Python for non-engineers
How to install Anaconda with pyenv
How to rebuild python environment from pyenv on Mac environment (El Capitan)
How about Anaconda for building a machine learning environment in Python?
Building a Windows 7 environment for getting started with machine learning with Python
Try to extract a character string from an image with Python3
How to use an external editor for Python development with Grasshopper
Change the active version in Pyenv from anaconda to plain Python
Everything from building a Python environment to running it on Windows