import pandas and import numpy result in AttributeError: module 'numpy' has no attribute 'core'

3.2k Views Asked by At

I have an anaconda distribution of python.

I was tinkering with plot.ly and cufflinks (I installed via pip) and I upgraded numpy/pandas via pip as well. Probably a stupid thing to do outside of using conda install.

In any case, I restarted my machine and now import pandas and import numpy result in the error below.

I even did an update to conda via:

conda update --prefix C:\Users\shal\Anaconda3 anaconda

The problem persists even after that update.

My python version is:

3.5.1 |Anaconda 4.0.0 (64-bit)| (default, Feb 16 2016, 09:49:46) [MSC v.1900 64 bit (AMD64)]

UPDATE:

  • I re-installed numpy via conda install numpy and the problem persists.
  • I even did a conda clean -all and the problem persists.
  • Removed plot.ly via pip uninstall plot.ly

Looking closer at where the Error occured:

---> 11 import numpy.core.numeric as _nx
     12 from numpy.core.numeric import asarray, asanyarray, array, isnan, \
     13                 obj2sctype, zeros

AttributeError: module 'numpy' has no attribute 'core'

There is a directory named core in the numpy folder. In it there is a numeric.py file, which seems to be what is trying to be imported in line 11. I'm not sure why the error occurs at all since I do have a directory named core in the numpy folder and the file that it is trying to access i.e. numeric.py.

The question then becomes what directory is the call to import numpy as np looking for the module to be in?

Anyone have any ideas on what may be the problem and what I can do to fix?

Error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-3-4ee716103900> in <module>()
----> 1 import numpy as np

C:\Users\blah\Anaconda3\lib\site-packages\numpy\__init__.py in <module>()
    140         return loader(*packages, **options)
    141 
--> 142     from . import add_newdocs
    143     __all__ = ['add_newdocs',
    144                'ModuleDeprecationWarning',

C:\Users\blah\Anaconda3\lib\site-packages\numpy\add_newdocs.py in <module>()
     11 from __future__ import division, absolute_import, print_function
     12 
---> 13 from numpy.lib import add_newdoc
     14 
     15 ###############################################################################

C:\Users\blah\Anaconda3\lib\site-packages\numpy\lib\__init__.py in <module>()
      6 from numpy.version import version as __version__
      7 
----> 8 from .type_check import *
      9 from .index_tricks import *
     10 from .function_base import *

C:\Users\blah\Anaconda3\lib\site-packages\numpy\lib\type_check.py in <module>()
      9            'common_type']
     10 
---> 11 import numpy.core.numeric as _nx
     12 from numpy.core.numeric import asarray, asanyarray, array, isnan, \
     13                 obj2sctype, zeros

AttributeError: module 'numpy' has no attribute 'core'
0

There are 0 best solutions below