[PYTHON] Build a PyData environment for a machine learning study session (January 2017)

Prerequisites

We have decided to hold a study session on the subject of Python Machine Learning Programming (Impress). Since Python 3.6 has also been released, I will summarize how to build the environment again.

The environment construction performed here is as follows.

The following is assumed to have been installed.

$ VirtualBox --help
Oracle VM VirtualBox Manager 5.0.30

$ vagrant version
Installed Version: 1.9.1
Latest Version: 1.9.1

VirtualBox + Vagrant

Prepare a folder for Vagrant. This time, I will study machine learning, so prepare a folder called ~ / vagrant / ml-study and prepare the environment.

$ mkdir ~/vagrant/ml-study

Addition of Vagrant Box

$ vagrant box add ubuntu/xenial64 https://atlas.hashicorp.com/ubuntu/boxes/xenial64/versions/20170104.0.0/providers/virtualbox.box

Start Vagrant

$ vagrant init ubuntu/xenial64
$ vagrant up

Vagrant settings (edit Vagrantfile) Enable config.vm.provision at the bottom and write:

...
  config.vm.provision "shell", inline: <<-SHELL
    apt-get update
    sudo apt-get install -y build-essential libssl-dev libxml2-dev libxslt1-dev libbz2-dev zlib1g-dev python-setuptools python-dev libjpeg62-dev libreadline-gplv2-dev
    sudo apt-get install -y libblas-dev liblas-dev liblapack-dev gfortran libfreetype6-dev
  SHELL
...

Reflection of settings

$ vagrant provision

OS related packages

Since the necessary packages are described in Vagrantfile, it will be installed on the vagrant side.

Python 3.6

$ mkdir ~/tmp
$ sudo mkdir /opt/python36
$ sudo chown ubuntu /opt/python36
$ cd tmp
$ wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz
$ tar zxvf Python-3.6.0.tgz
$ cd Python-3.6.0/
$ ./configure --prefix=/opt/python36
$ make && make install
$ cd ~
$ /opt/python36/bin/python3 -m venv python
$ source python/bin/activate

Python related modules

$ pip install numpy scipy pandas scikit-learn matplotlib
$ pip install ipython[notebook]
$ pip install seaborn
$ pip install pyprind

When using after setting

$ cd ~/vagrant/ml-study
$ vagrant up
$ vagrant ssh
$ cd ~
$ source python/bin/activate
$ jupyter notebook

When stopped

$ vagrant halt

jupyter notebook settings

(Added on January 8, 2017)

When I try to access Jupyter notebook directly from the host machine with a browser, it is rejected due to IP restrictions. IP restrictions can be lifted by making the following settings.

$ source python/bin/activate
$ jupyter notebook --generate-config

~/.jupyter/jupyter_notebook_config.py


c.NotebookApp.ip = '*'

Recommended Posts

Build a PyData environment for a machine learning study session (January 2017)
Build a machine learning environment
Build a python machine learning study environment on macOS sierra
Creating a development environment for machine learning
Build a Python machine learning environment with a container
Build an interactive environment for machine learning in Python
Build a machine learning Python environment on Mac OS
Memo for building a machine learning environment using Python
Build a machine learning environment natively on Windows 10 (x64)
Build a machine learning environment on mac (pyenv, deeplearning, opencv)
Build an environment for machine learning using Python on MacOSX
Build a machine learning scikit-learn environment with VirtualBox and Ubuntu
How about Anaconda for building a machine learning environment in Python?
Building a Windows 7 environment for getting started with machine learning with Python
Build AI / machine learning environment with Python
Quickly build a python environment for deep learning and data science (Windows)
Recommended study order for machine learning / deep learning beginners
Build a Kubernetes environment for development on Ubuntu
Build a mruby development environment for ESP32 (Linux)
Build a local development environment for Laravel6.X on Mac
Build a python environment for each directory with pyenv-virtualenv
[Python] I made a classifier for irises [Machine learning]
How to build a development environment for TensorFlow (1.0.0) (Mac)
Study method for learning machine learning from scratch (March 2020 version)
xgboost: A valid machine learning model for table data
Build a Django environment for Win10 (with virtual space)
Create a machine learning environment from scratch with Winsows 10
Build a machine learning environment using PyCharm on Ubuntu environment (TensorFlow will also be introduced!)
You don't need to install Anaconda to build a machine learning environment. Let's use Miniconda
I tried to build an environment for machine learning with Python (Mac OS X)
Rebuilding an environment for machine learning with Miniconda (Windows version)
Data set for machine learning
[Memo] Build a development environment for Django + Nuxt.js with Docker
Easily build a GCP environment for Kaggle at high speed
Build a LAMP environment [CentOS 7]
(Now) Build a GPU Deep Learning environment with GeForce GTX 960
Machine Learning Study Resource Notepad
Launching a machine learning environment using Google Compute Engine (GCE)
I tried using Tensorboard, a visualization tool for machine learning
Machine learning environment construction macbook 2021
Build a Python environment offline
Build a python environment on CentOS 7.7 for your home server
Build and test a CI environment for multiple versions of Python
Build a local development environment for Lambda + Python using Serverless Framework
Try using virtualenv, which can build a virtual environment for Python
[DynamoDB] [Docker] Build a development environment for DynamoDB and Django with docker-compose
Build a go environment using Docker
<For beginners> python library <For machine learning>
Inversely analyze a machine learning model
Machine learning meeting information for HRTech
[Recommended tagging for machine learning # 4] Machine learning script ...?
Build a python3 environment on CentOS7
[Definitive Edition] Building an environment for learning "machine learning" using Python on Windows
Build a version control environment for Python, Ruby, Perl, Node.js on UNIX
Build a "Deep learning from scratch" learning environment on Cloud9 (jupyter miniconda python3)
Building a machine learning environment with Tellus GPU server (Sakura high-power computing)
Build an environment for Blender built-in Python
Easily build a development environment with Laragon
How to build a sphinx translation environment
Amplify images for machine learning with python
Build a python environment on MacOS (Catallina)