[PYTHON] Put numpy scipy etc. in virtualenv of Ubuntu 12.04 LTS Server

I put Ubuntu 12.04 LTS Server in VirtualBox. Note that it took some time to put numpy and scripy in virtualenv.

$ sudo apt-get install python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose

It's easy to do, but this time I'll put it in virturlenv.

Edit source.list

$ sudo vi /etc/apt/source.list

Add this.

source.list


deb http://ftp.tsukuba.wide.ad.jp/Linux/ubuntu/ precise main universe
deb-src http://ftp.tsukuba.wide.ad.jp/Linux/ubuntu/ precise main universe

I will do it after adding it.

$ sudo apt-get update
$ sudo apt-get upgrade

pip installation

$ wget https://bootstrap.pypa.io/get-pip.py
$ sudo python get-pip.py

Install virtualenv

$ sudo pip install virtualenv

Install required packages for numpy, scipy

$ sudo apt-get install python-gtk2-dev
$ sudo apt-get install gfortran
$ sudo apt-get install swig
$ sudo apt-get install liblapack-dev

Creating a virtualenv

$ virtualenv venv2.7
$ cd vevn2.7
$ source bin/activate #Enter the virtualenv environment

Installation of numpy, scipy, etc.

(venv2.7)$ pip install numpy
(venv2.7)$ pip install scipy
(venv2.7)$ pip install matplotlib
(venv2.7)$ pip install pandas
(venv2.7)$ pip install ipython
(venv2.7)$ pip install tornado
(venv2.7)$ pip install pyzmq
(venv2.7)$ pip install jinja2
(venv2.7)$ pip install scikit-learn

Confirmation of installation

(venv2.7)$ python
>>> import numpy
>>> import scipy
>>> import matplotlib
>>> import pandas
>>> import sklearn

If there is no error with this, OK. I didn't know what package I needed, and that was the reason why it took a lot of time.

Recommended Posts

Put numpy scipy etc. in virtualenv of Ubuntu 12.04 LTS Server
Put python, numpy, opencv3 in ubuntu14
Put scipy in ec2
About import error of numpy and scipy in anaconda
I tried to put PyCharm in Ubuntu 16.04 LTS (PPA cannot be used)
I put Linux (Ubuntu) in VAIO SX14.
Automation of server monitoring etc. with Monit
(Not yet) Don't put Ubuntu 20.04 in WSL1