How to build a beautiful Python environment on a new Mac and install Jupter Notebook

0. Introduction

This is a memo when I built the environment to use the local Jupter Notebook because I changed the model of Mac.

0-1. Prerequisites

Python 2.x is installed as standard on Mac. However, I want to handle Python 3.x, so I will introduce Python 3.x first. (Python 2.x may be used in other apps, so keep it clean.) Also, since it is a personal environment, it may not be necessary so much, but we use venv to separate the environment. You can use venv to separate multiple installation packages independently. (Introduced as standard from Python 3.3.) Python2.x and Python3.x are not separated using pyenv.

0-2. Introduction step

1.1. Installing Homebrew 1.2. Installing Python 3 1.3. pip update 1.4. venv preferences 1.5. Installing libraries that may be needed 1.6. Installing Jupyter Notebook

1. Introduction

Here are the introduction steps.

1.1. Installing Homebrew

Please check here for the installation method.

1.2. Installing Python 3

Terminal


$ brew install python3

1.3. pip update

Terminal


$ pip3 install --upgrade setuptools
$ pip3 install --upgrade pip

pip is a package manager used by Python. It will be installed at the same time when Python 3 is installed. Since it is Python 3.x, it is pip3. If you get a Permission error, try running it with Sudo.

1.4. venv preferences

Terminal


$ cd [Installation directory]
$ python3 -m venv [Environment name]

This will create an Environment Name folder in the Installation Directory and install the required components under it. The following command will enable venv. (Env) is added to the terminal. When you are finished, command "deactive".

Terminal


$ . [Environment name]/bin/activate
$ deactivate

1.5. Installing libraries that may be needed

Install the Python library that Jupter may need.

Terminal


$ pip install numpy
$ pip install scipy
$ pip install scikit-learn
$ pip install Pillow
$ pip install pandas
$ pip install matplotlib

1.6. Installing Jupyter Notebook

Terminal


$ pip install jupyter

2. Launch Jupyter Notebook

Terminal


$ jupyter notebook

3. Bonus (change of appearance using Jupyter themes)

The standard setting is white-based, and I personally don't like it because the font size is a bit small. Introducing a look-changing package called Jupyterthemes.

Terminal


$ pip install jupyterthemes
$ pip install --upgrade jupyterthemes

Set your favorite theme. Find out more about the theme yourself.

Terminal


jt -t oceans16

This is my setting.

Terminal


jt -t oceans16 -T -N -kl -fs 11 -ofs 10 -tfs 11 -dfs 9 -ofs 10 -cellw 80%

that's all.

Recommended Posts

How to build a beautiful Python environment on a new Mac and install Jupter Notebook
How to build a new python virtual environment on Ubuntu
Install Python3 on Mac and build environment [Definitive Edition]
How to build a Django (python) environment on docker
How to build a Python environment on amazon linux 2
[Python] How to save the installed package and install it in a new environment at once Mac environment
Build a Python environment on your Mac with Anaconda and PyCharm
How to build a Python environment using Virtualenv on Ubuntu 18.04 LTS
Build a Python environment on Mac (Mountain Lion)
Build a Python development environment on your Mac
After buying a new Mac, use pyenv + poetry to build a Python environment.
Try to build python and anaconda environment on Mac (by pyenv, conda)
Build Linux on a Windows environment. Steps to install Laradock and migrate
How to build a Python virtual execution environment using Visual Studio Code and pipenv on a Windows machine (also Jupyter notebook)
Build a machine learning Python environment on Mac OS
Build a Python development environment on Mac OS X
Build a Python environment on your Mac using pyenv
How to build a development environment for TensorFlow (1.0.0) (Mac)
How to build an environment for using multiple versions of Python on Mac
Install and set Jupyter Notebook to create a study note creation environment [Mac]
Build a PYNQ environment on Ultra96 V2 and log in to Jupyter Notebook
Building a Python environment on Mac
How to install mysql-connector-python on mac
Building a Python environment on a Mac and using Jupyter lab
Create a Python environment on Mac (2017/4)
How to install OpenCV on Mac
Build a python data analysis environment on Mac (El Capitan)
How to create a Python 3.6.0 environment by putting pyenv on Amazon Linux and Ubuntu
Build a Python environment and transfer data to the server
How to build a python2.7 series development environment with Vagrant
Steps to install python3 on mac
Build a python3 environment on CentOS7
How to build a LAMP environment using Vagrant and VirtulBox Note
How to install OpenCV on Cloud9 and run it in Python
How to rebuild python environment from pyenv on Mac environment (El Capitan)
Build a 64-bit Python 2.7 environment with TDM-GCC and MinGW-w64 on Windows 7
Install Anaconda on Mac and upload Jupyter (IPython) notebook to Anaconda Cloud
How to build Python and Jupyter execution environment with VS Code
How to build a sphinx translation environment
How to install drobertadams / toggl-cli on Mac
How to install and use pandas_datareader [Python]
Build Python3 and OpenCV environment on Ubuntu 18.04
[Kivy] How to install Kivy on Windows [Python]
Build a python environment on MacOS (Catallina)
Create a python environment on your Mac
I want to build a Python environment
Steps to install Python environment on Ubuntu
How to prepare Python development environment [Mac]
How to erase Python 2.x on Mac.
Build Python environment with Anaconda on Mac
Install anaconda on a new Mac anyway
Build a Python + OpenCV environment on Cloud9
Building a Python development environment on Windows -From installing Anaconda to linking Atom and Jupyter Notebook-
How to make Python 3.x and 2.x coexist on Mac (I also included opencv as a bonus)
Anyone can understand how to build an initial environment for Python on Mac September 2016 (pyenv + virutalenv)
Things to watch out for when creating a Python environment on a Mac
How to install python package in local environment as a general user
Create a Python3 environment with pyenv on Mac and display a NetworkX graph
I tried to build a Mac Python development environment with pythonz + direnv
How to create a Python virtual environment (venv)
[2020 version] How to install Python3 on AWS EC2