6

I have used easy_install to install numpy to install numpy 1.7.1, but when I check my version in python:

python -c "import numpy; print numpy.version.version"

It says 1.6.2

What am I doing wrong?

jlonganecker
  • 1,180
  • 11
  • 20
  • 1
    I advise you to use a [virtualenv](http://stackoverflow.com/questions/5844869/comprehensive-beginners-virtualenv-tutorial) if you want to work with specific versions. – Yohann May 06 '13 at 03:04

2 Answers2

7

Most likely, you have installed numpy from a debian repository or a pip installation with other parameters. Use

python -c 'import os,numpy;print(numpy.__file__)'

to find out where the rogue numpy version lies. While you can just delete this directory, you can also ask your package manager what package the file belongs to. Again, on a debian system:

$ python -c 'import numpy;print(numpy.__file__)'
/usr/lib/pymodules/python2.7/numpy/__init__.pyc
$ readlink -f /usr/lib/pymodules/python2.7/numpy/__init__.py
/usr/share/pyshared/numpy/__init__.py
$ dpkg -S /usr/share/pyshared/numpy/__init__.py
python-numpy: /usr/share/pyshared/numpy/__init__.py
$ sudo apt-get remove python-numpy
phihag
  • 278,196
  • 72
  • 453
  • 469
  • Using the numpy.__file__ helped me tracked down where the numpy install was and I was able to do the rest myself. Thanks! – jlonganecker May 11 '13 at 18:30
2

sudo easy_install -U numpy

...after many tries, the code above worked for me, finally!

Jacob Irwin
  • 153
  • 1
  • 13