When I try:
$ sudo pip install numpy
on my Ubuntu 12.04 server, I get:
----------------------------------------------------
pip
won't install the necessary compilers for you.
If you simply want numpy, and don't need to go through pip, use
sudo apt-get install python-numpy
and you'll get all the requisites as well (such as python-dev
).
Incase you do not have access to any internet, then try downloading its dependencies too manually like intel_Openmp, MKL,MKL_include and MKL-devel first and then install numpy
It seems like your system does not have gcc
.
Install build tools using following command:
apt-get install build-essential python-dev
Some of these packages may not be required (don't have time to check in detail) but in a setup script of mine to install the NumPy stack I install the following Ubuntu packages first:
- build-essential
- gfortran
- libatlas-base-dev
- libatlas3gf-base
- python-dev
- libjpeg-dev
- libxml2-dev
- libfreetype6-dev
- libpng-dev
Otherwise you could simply use the Anaconda Python distribution, which works great.
I used to get almost same type of errors but solved it using a virtual environment. There are many environments but I personally suggest venv.
I was able to easily get rid of the errors using venv.
It is because loading all libraries on OS using sudo
is not appropriate.
Your OS becomes big and gives unwanted errors.