Reputation: 1
I just installed Enthought Canopy on an Imac Os 10.6.8. I get an error message (appended below) when I try to test sklearn. The error is ImportError: numpy.core.multiarray failed to import. It looks like the wrong version of numpy is being used. I'm not sure how to fix.
mu51220:~ rscherl$ python Enthought Canopy Python 2.7.3 | 32-bit | (default, Jun 14 2013, 18:24:40) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information.
from sklearn import datasets /Library/Python/2.6/site-packages/numpy/random/init.py:87: RuntimeWarning: compiletime version 2.6 of module 'mtrand' does not match runtime version 2.7 from mtrand import * RuntimeError: module compiled against API version 7 but this version of numpy is 6 Traceback (most recent call last): File "", line 1, in File "/Users/rscherl/Library/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/sklearn/init.py", line 32, in from .base import clone File "/Users/rscherl/Library/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/sklearn/base.py", line 10, in from scipy import sparse File "/Users/rscherl/Library/Enthought/Canopy_32bit/System/lib/python2.7/site-packages/scipy/sparse/init.py", line 182, in from .csr import * File "/Users/rscherl/Library/Enthought/Canopy_32bit/System/lib/python2.7/site-packages/scipy/sparse/csr.py", line 15, in from .sparsetools import csr_tocsc, csr_tobsr, csr_count_blocks, \ File "/Users/rscherl/Library/Enthought/Canopy_32bit/System/lib/python2.7/site-packages/scipy/sparse/sparsetools/init.py", line 5, in from .csr import * File "/Users/rscherl/Library/Enthought/Canopy_32bit/System/lib/python2.7/site-packages/scipy/sparse/sparsetools/csr.py", line 26, in _csr = swig_import_helper() File "/Users/rscherl/Library/Enthought/Canopy_32bit/System/lib/python2.7/site-packages/scipy/sparse/sparsetools/csr.py", line 22, in swig_import_helper _mod = imp.load_module('_csr', fp, pathname, description) ImportError: numpy.core.multiarray failed to import
Upvotes: 0
Views: 764
Reputation: 1
I discovered that I had in my PYTHONPATH (as defined in my .profile) /Library/Python/2.6/site-packages from where the wrong version of numpy was being picked up. Eliminating this corrected the problem.
Upvotes: 0