ImportError: cannot import name add_newdocs

后端 未结 7 1626
轮回少年
轮回少年 2021-02-14 13:28

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: c

7条回答
  •  余生分开走
    2021-02-14 14:08

    I encountered the same error; in my case maybe because there were two python directories in the path (there's normal python and an anaconda python) - both have numpy. The former was added via

    sys.path.insert(0,'/usr/local/lib/python2.7/dist-packages')
    

    Replacing this with:

    site.addsitedir('/usr/local/lib/python2.7/dist-packages')
    

    solved the problem for some reason.

    I can't reproduce the original "add_newdocs" error now, though. As written here there are issues with ...insert(0,..), but ..insert(1,..) also gives errors...

提交回复
热议问题