Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: cannot import name add_newdocs

I use Windows8.1 and python 2.7 and I installed the numpy1.8. However, whenever I wanna import numpy it shows the following error :ImportError: cannot import name add_newdocs.

>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\numpy\__init__.py", line 153, in <module>
    from . import add_newdocs
ImportError: cannot import name add_newdocs

I have checked with C:\Python27\Lib\site-packages\numpy the add_newdocs does exist.

Can somebody tell me how to fix it?

like image 445
mlo0424 Avatar asked Mar 17 '14 20:03

mlo0424


2 Answers

just reinstall if your use anaconda conda install numpy I resolve it by doing that

like image 147
user3337470 Avatar answered Oct 07 '22 07:10

user3337470


I had a similar problem to this. First make sure that you can at least import numpy in the terminal python shell without the import error. If this is not the case, then it could be that a complete reinstall of numpy is necessary (or maybe as some other posts have said your pyc file for add_newdocs went "stale", needs to be deleted and will automatically be recreated and thus problem will be solved)

Or. The import does work in terminal and, (in my one experience with this bug) it was a problem of file names in the same folder. Moving the file that imported numpy out of that folder solved the issue.

Or its none of the above and in that case I'm out of ideas

like image 38
Amee wongstein Avatar answered Oct 07 '22 08:10

Amee wongstein