-1

I've searched everywhere I could and I couldn't find appropriate answer. I don't know how to install numpy so I could use it in Geany with python 3.1.2. It only works for python 2.6.5. I'm new to ubuntu.

edit: I get ImportError: No module named numpy

pb2q
  • 58,613
  • 19
  • 146
  • 147
malganis
  • 780
  • 1
  • 5
  • 8

2 Answers2

2

If python 3.1.2 is installed via python3 package then you could try:

$ sudo apt-get install python3-numpy
jfs
  • 399,953
  • 195
  • 994
  • 1,670
  • I get "Couldn't find package python3-numpy". And from what I have read about this it's not that simple. – malganis Oct 14 '12 at 00:29
  • @malganis: It is that simple on 12.04. To experiment create a vurtualenv (using python3 binary) and run: `pip install numpy` inside the environment (I do it to install recent numpy versions). You might need to install dependencies before it. A simple way to do it is to run: `sudo apt-get build-dep python-numpy`. – jfs Oct 14 '12 at 00:49
  • "To experiment create a virtualenv (using python3 binary) and run: pip install numpy inside the environment (I do it to install recent numpy versions)" What exactly do you mean by that? I put this into terminal and I get "The program 'pip' can be found in the following packages: * pip * python-pip Try: sudo apt-get install " I have installed dependancies. – malganis Oct 14 '12 at 00:57
  • Would it work if I install it from here http://sourceforge.net/projects/numpy/files? The problem is then I don't know how to install from tar files. If it is not step by step I get lost. – malganis Oct 14 '12 at 01:11
  • @malganis: here's [step-by-step instruction on how to install and create a vurtualenv](http://stackoverflow.com/a/5177027/4279) (choose a more recent virtualenv version and use the path to python3). Use only pip that is installed inside your environment, don't try to install using system pip. `pip` automatically downloads necessary files, builds and installs them (it takes a while for numpy). – jfs Oct 14 '12 at 01:23
0

Tried the apt-get installation solution above but it didn't work, however, pip did work:

$ sudo pip3 install numpy

Also, here are the install instructions for pip if needed.

brasofilo
  • 25,496
  • 15
  • 91
  • 179
JT5D
  • 1