seb
seb

Reputation: 2321

Building NumPy 1.7.1 on Ubuntu

I'm a newby in both Ubuntu and Python, so please bear with me. I need some functionality included in NumPy 1.7.1. My Ubuntu 12.04 LTE, however, comes with NumPy 1.6.x, and sudo apt-get update doesn't get it any higher.

So I went to sourceforge and followed the instructions given here in userguide.pdf. I have made up to:

python setup.py build --fcompiler=gnu95

, i.e. I have (from what it seems like, successfully) built NumPy 1.7.1. The question is: what do I do now? Should I move some directories somewhere, if yes, where? The userguide.pdf just stops here and doesn't give any more information.

This is the first time, I'm ever trying this, so please be kind ;-).

Upvotes: 5

Views: 2397

Answers (2)

Franck Dernoncourt
Franck Dernoncourt

Reputation: 83427

If you need to upgrade NumPy to a newer version (not 1.7.1 specifically), you can use pip:

sudo apt-get install python-pip
sudo pip install numpy --upgrade

It will install NumPy 1.8.1 on Ubuntu 12.04:

import numpy
numpy.version.version
>>> '1.8.1'

Upvotes: 0

Francesco Montesano
Francesco Montesano

Reputation: 8668

When I install some python package from source I usually do

python setup.py build [options]
python setup.py install --user

The last step install the package in ~/.local/lib/pythonX.X/site-packages/. This directory is scanned before the system directories (so this version is used). Furthermore you don't need sudo and you don't risk to mess up with what apt installs

Upvotes: 6

Related Questions