Can't see numpy etc after upgrading Python on Ubuntu

ozpeterballard at gmail.com ozpeterballard at gmail.com
Tue Dec 20 00:08:35 EST 2016


Hi all. I hope this is the right place. It seems more like a Python problem than an Ubuntu problem.

I use Python on Ubuntu 12.04. Recently I upgraded Python from 2.7.3 to 2.7.12. I did the upgrade via the source, i.e. download (from https://www.python.org/downloads/release/python-2712/ ), tar, ./config, sudo make install.

After the upgrade, python could no longer see the 3rd party modules I use (numpy, scipy, matplotlib, cython). I can point PYTHONPATH to the cython files, but I can't work out how to include numpy, scipy and matplotlib.

It's no good asking Ubuntu to upgrade, because apt-get tells me that numpy, scipy and matplotlib are all up to date.

So what do I do so I can see these packages again?

p.s. results of a few commands:

$ which python
/usr/local/bin/python

$ find /usr -name 'numpy*'
/usr/share/pyshared/numpy-1.6.1.egg-info
/usr/share/pyshared/scipy/weave/numpy_scalar_spec.py
/usr/share/pyshared/numpy
/usr/share/pyshared/numpy/core/include/numpy
/usr/share/pyshared/numpy/core/include/numpy/numpyconfig.h
/usr/share/pyshared/numpy/numarray/include/numpy
/usr/share/pyshared/numpy/testing/numpytest.py
/usr/share/pyshared/numpy/distutils/numpy_distribution.py
/usr/share/numpy
/usr/lib/python2.7/dist-packages/numpy-1.6.1.egg-info
/usr/lib/python2.7/dist-packages/scipy/weave/numpy_scalar_spec.py
/usr/lib/python2.7/dist-packages/scipy/weave/numpy_scalar_spec.pyc
/usr/lib/python2.7/dist-packages/numpy
/usr/lib/python2.7/dist-packages/numpy/core/include/numpy
/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/numpyconfig.h
/usr/lib/python2.7/dist-packages/numpy/numarray/include/numpy
/usr/lib/python2.7/dist-packages/numpy/testing/numpytest.py
/usr/lib/python2.7/dist-packages/numpy/testing/numpytest.pyc
/usr/lib/python2.7/dist-packages/numpy/distutils/numpy_distribution.pyc
/usr/lib/python2.7/dist-packages/numpy/distutils/numpy_distribution.py
/usr/lib/pyshared/python2.7/numpy
/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy
/usr/include/python2.7/numpy
/usr/include/python2.7_d/numpy
/usr/include/numpy

... and fairly similar results for scipy and matplotlib.

My bash PYTHONPATH is:

PYTHONPATH=:/home/peter/dvd/software/python:/home/peter/Cython-0.25.2

My sys.path in python is:

>>> sys.path
['', '/home/peter', '/home/peter/dvd/software/python', '/home/peter/Cython-0.25.2', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-linux2', '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/python2.7/lib-old', '/usr/local/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/site-packages']


More information about the Python-list mailing list