Building a PyData environment for a machine learning study session (January 2017) Building an environment for Ubuntu using VirtualBox I wrote, but I also want it for Mac, so I am writing it.
This article is a Python standard environment construction method. We recommend this method.
I think it is good to prepare the environment like this for studying the following books.
-Machine Learning Python Programming (Impress)
Python 3.6
--Get the Mac OS X 64-bit / 32-bit installer
from the Python download https://www.python.org/downloads/release/python-360/
--After downloading, double-click to install.
Python can be used with python3
on Mac OS
Describe by building the environment in ~ / work / tmp
.
$ mkdir ~/work/tmp
$ cd ~/work/tmp
$ python3 -m venv env
You now have a Python virtual environment in ~ / work / tmp / env
I'm using a standard Python virtual environment creation tool called venv
.
$ cd ~/work/tmp
$ source env/bin/activate
(env)$ pip install numpy scipy pandas scikit-learn matplotlib
(env)$ pip install ipython[notebook]
Enable the Python virtual environment with the source
command and install the library with pip
.
The binary package is provided by wheel
, which eliminates the need for compilation and can be easily installed in a Mac OS environment without installing an external module of the OS.
$ cd ~/work/tmp
$ source env/bin/activate
(env)$ jupyter notebook
Immediately after installing the library, the source
command is executed and you are in the Python virtual environment, so you do not need to execute the source
command.
Recommended Posts