This is a memo when I built the environment to use the local Jupter Notebook because I changed the model of Mac.
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.
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
Here are the introduction steps.
Please check here for the installation method.
Terminal
$ brew install python3
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.
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
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
Terminal
$ pip install jupyter
Terminal
$ jupyter notebook
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