1

I have used pip to update and install some libraries on a computer that hadd an old Numpy version. But it doesn't seem to be actually applied:

davidm@illergard:~$ python
Python 2.7.3 (default, Feb 27 2014, 19:58:35) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.__version__
'1.6.1'

Ipython, on the other hand, does see the new libraries:

davidm@illergard:~$ ipython
Python 2.7.3 (default, Feb 27 2014, 19:58:35) 
Type "copyright", "credits" or "license" for more information.

IPython 2.1.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import numpy

In [2]: numpy.__version__
Out[2]: '1.8.1'

This would suggest Ipython is running a different Python. Let's see it:

davidm@illergard:~$ which python
/usr/bin/python
davidm@illergard:~$ which ipython
/usr/local/bin/ipython

davidm@illergard:~$ cat /usr/local/bin/ipython
#!/usr/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'ipython==2.1.0','console_scripts','ipython'
__requires__ = 'ipython==2.1.0'
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.exit(
        load_entry_point('ipython==2.1.0', 'console_scripts', 'ipython')()
    )

The shebang corresponds to the very same Python! Virtualenv is not installed, so that is not the problem.

System information:

davidm@illergard:~$ uname -a
Linux illergard 3.2.0-65-generic #99-Ubuntu SMP Fri Jul 4 21:03:29 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

davidm@illergard:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.4 LTS
Release:    12.04
Codename:   precise

Related: https://stackoverflow.com/questions/9386048/ipython-reads-wrong-python-version

1 Answer 1

0

I don't know the cause, and I will be happy if someone can point it out, but I found a solution. Running

sudo python ez_setup.py

from ez_setup.py obtained here, magically solved the problem, and now python sees the updated libraries. No reinstallation was needed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .