[PYTHON] homebrew, pyenv, anaconda, Jupyter Notebook

environment

Overview

--Homebrew installation --pyenv installation --Anaconda installation -(I gave up building a virtual environment) --Start Jupyter Notebook

Detailed procedure

1. Install Homebrew

terminal


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

2. Homebrew environment update

For the time being, it was said to be Already up-to-date.

3. Install pyenv

terminal


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

$ exec $SHELL -l

4. Install Anaconda

terminal


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

It seems that pyenv global is trying to run the corresponding Python version in all directories. If you want to use the corresponding version only in a specific directory, it seems that you should do something like pyenv local anaconda3-2019.10.

5. Confirmation of installation completion

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

That's right, but this doesn't work.

6. Try installing a different version of Anaconda

terminal


$ pyenv install anaconda3-5.3.1
$ pyenv global anaconda3-5.3.1

$ python 3

terminal


Python 3.6.1 (v3.6.1:69c0db5050, Mar 21 2017, 01:21:04) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

So there is no sign of anaconda

7. Look through PATH

terminal


$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
$ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
$ source ~/.bash_profile
$ pyenv rehash
$ python3
Python 3.7.0 (default, Jun 28 2018, 07:39:16) 
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.

Oh. Signs of Anaconda.

terminal


$ jupyter notebook

It started with!

8. Cause

I thought it was zsh from macOS Catalina, The update user is bash, You should change it to zsh.

In macOS 10.15 Catalina, the default login shell is changed from "bash" to "zsh".

Well, I have to change the shell to zsh. If that happens, Anaconda and pyenv will not move. I wonder if ... Good luck.

reference

[Jupyter Notebook] Let's know how to use it effectively [Python / Machine learning]

Understanding the essence of environment construction (concepts such as PATH) [Python]

[Note from installing Homebrew to building an Anaconda environment for Python with pyenv] (https://qiita.com/aical/items/2d066801a7464a676994)

[Keras / TensorFlow] Keras (Tensorflow) environment construction

Recommended Posts

homebrew, pyenv, anaconda, Jupyter Notebook
Python memo Anaconda x Jupyter Notebook
Jupyter Notebook memo
Introducing Jupyter Notebook
Powerful Jupyter Notebook
pyenv + virtualenv + Anaconda
pyenv + anaconda + python3
Jupyter notebook password
Jupyter Notebook memo
Error running Jupyter Notebook in Anaconda virtual environment
Get started Jupyter Notebook
3 Jupyter notebook (Python) tricks
[Cloud103] # 3 Jupyter Notebook again
Python environment construction on Mac (pyenv, virtualenv, anaconda, ipython notebook)
Shortcut key for Jupyter notebook
Introduced Jupyter Notebook to CentOS 7
Using Graphviz with Jupyter Notebook
Use Anaconda in pyenv environment
[CentOS7] Install anaconda using pyenv
Display HTML in Jupyter notebook
Use pip with Jupyter Notebook
Multiprocessing error in Jupyter Notebook
Try using Jupyter Notebook dynamically
[Super Basics] About jupyter Notebook
High charts on Jupyter notebook
View PDF on Jupyter Notebook
Use Cython with Jupyter Notebook
Play with Jupyter Notebook (IPython Notebook)
Install pyenv from Homebrew, install Python from pyenv
[Complete version] Jupyter Notebook shortcut
[Python] Anaconda, pyenv, virtualenv, .bash_profile
Run Jupyter Notebook on windows
How to use Jupyter Notebook
python3.8 venv environment jupyter notebook
Install Anaconda on Mac and upload Jupyter (IPython) notebook to Anaconda Cloud
Jupyter Notebook 6.0.2 cannot be installed in the Python 2.7 environment created in Anaconda
Snippet settings for python jupyter notebook
Jupyter Notebook essential for software development
Post a Jupyter Notebook as a blog post
Visualize decision trees with jupyter notebook
Make a sound with Jupyter notebook
Jupyter Notebook Magic Command Personal Summary
Paste Jupyter Notebook document into Wordpress
Generate Jupyter notebook ".ipynb" in Python
Simply view the Jupyter notebook file
Python environment construction (pyenv, anaconda, tensorflow)
Run azure ML on jupyter notebook
Jupyter Notebook: 4 banal tips and tricks
[MEMO] [Development environment construction] Jupyter Notebook
Use markdown with jupyter notebook (with shortcut)
Add more kernels with Jupyter Notebook
View graphs inline in Jupyter Notebook
Convenient analysis with Pandas + Jupyter notebook
Launch jupyter notebook (+ take security measures)
Easy to use Jupyter notebook (Python3.5)
Created an environment for Anaconda & Jupyter
Try running Jupyter Notebook on Mac
Spark play with WSL anaconda jupyter (2)
Somehow I tried using jupyter notebook
Try starting Jupyter Notebook ~ Esper training
How to install Anaconda with pyenv