python2.7.6 numpy 1.8.1 is actually api 7, not compatible with scipy or matplotlib
For python 2.7.6 numpy1.8.1 is api 7 and is no longer compatible with matplotlib, or scipy which are at a higher api 9. This effectively makes numpy useless for scientific users.
Ubuntu 14.04 LTS
Version 14.04.5
python-numpy:
Installed: 1:1.8.1-1ubuntu1
Candidate: 1:1.8.1-1ubuntu1
Version table:
*** 1:1.8.1-1ubuntu1 0
500 http://
100 /var/lib/
example:
$ ipython
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
Type "copyright", "credits" or "license" for more information.
IPython 1.2.1 -- 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]: from scipy.io import savemat
-------
RuntimeError Traceback (most recent call last)
RuntimeError: module compiled against API version 9 but this version of numpy is 7
-------
ImportError Traceback (most recent call last)
<ipython-
----> 1 from scipy.io import savemat
/usr/lib/
83
84 # matfile read and write
---> 85 from .matlab import loadmat, savemat, whosmat, byteordercodes
86
87 # netCDF file support
/usr/lib/
11
12 # Matlab file read and write utilities
---> 13 from .mio import loadmat, savemat, whosmat
14 from . import byteordercodes
15
/usr/lib/
11
12 from .miobase import get_matfile_
---> 13 from .mio4 import MatFile4Reader, MatFile4Writer
14 from .mio5 import MatFile5Reader, MatFile5Writer
15
/usr/lib/
9 from numpy.compat import asbytes, asstr
10
---> 11 import scipy.sparse
12
13 from scipy.lib.six import string_types
/usr/lib/
204
205 from .base import *
--> 206 from .csr import *
207 from .csc import *
208 from .lil import *
/usr/lib/
13 from scipy.lib.six.moves import xrange
14
---> 15 from .sparsetools import csr_tocsc, csr_tobsr, csr_count_blocks, \
16 get_csr_submatrix, csr_sample_values
17 from .sputils import upcast, isintlike, IndexMixin, issequence
/usr/lib/
3 from __future__ import division, print_function, absolute_import
4
----> 5 from .csr import *
6 from .csc import *
7 from .coo import *
/usr/lib/
26 fp.close()
27 return _mod
---> 28 _csr = swig_import_
29 del swig_import_helper
30 else:
/usr/lib/
22 if fp is not None:
23 try:
---> 24 _mod = imp.load_
25 finally:
26 fp.close()
ImportError: numpy.core.
In [2]: import numpy
In [3]: numpy.__version__
Out[3]: '1.7.1'
I get the same error if I import in plain python
$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy.io as sio
RuntimeError: module compiled against API version 9 but this version of numpy is 7
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/
from .matlab import loadmat, savemat, whosmat, byteordercodes
File "/usr/lib/
from .mio import loadmat, savemat, whosmat
File "/usr/lib/
from .mio4 import MatFile4Reader, MatFile4Writer
File "/usr/lib/
import scipy.sparse
File "/usr/lib/
from .csr import *
File "/usr/lib/
from .sparsetools import csr_tocsc, csr_tobsr, csr_count_blocks, \
File "/usr/lib/
from .csr import *
File "/usr/lib/
_csr = swig_import_
File "/usr/lib/
_mod = imp.load_
ImportError: numpy.core.
>>>
python3 is ok, python2.7 is not.
$ python3
Python 3.4.0 (default, Apr 11 2014, 13:05:11)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy.io
>>> from scipy.io import savemat
>>> import numpy
>>> numpy.__version__
'1.8.1'
>>>
scipy version for python2 and python3 are both '0.13.3'
Python 2.7.x Numpy / scipy / matplotlib all worked together seamlessly in 13.10
I develop simulations at work using numpy/scipy/
The git release number seems to match that on PyPI, as of today. Maybe they are both wrong?
/usr/lib/
full_version = '1.8.1'
git_revision = '62a7575fd82ddf
release = True
From PyPI
numpy-1.
full_version = '1.8.1'
git_revision = '62a7575fd82ddf
release = True
Seems to be the same as the download from sourceforge. :(
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Bruce Labitt
- Solved:
- Last query:
- Last reply: