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

后端 未结 5 1118
眼角桃花
眼角桃花 2020-12-10 12:21

I updated my computer today, and am getting the following error message when I attempt to import pandas:

import pandas as pd        
AttributeError: module \         


        
相关标签:
5条回答
  • 2020-12-10 12:51

    Have you tried this:

    pip uninstall -y numpy
    pip uninstall -y setuptools
    pip install setuptools
    pip install numpy
    
    0 讨论(0)
  • 2020-12-10 12:56

    I had this error today while I was running a "brew upgrade" on MacOS and upgrade failed on matplotlib.

    <TLDR/>

    I run pip (v 2.x) and pip3 installed. It turned out I had not installed numpy with pip3. I ran

    pip3 install numpy
    

    brew upgrade then ran successfully.

    0 讨论(0)
  • 2020-12-10 12:59

    You may have named your program/script 'numpy'. I also had that then i renamed my program and then it works. It happens because when you name your program similar to a module the import attribute clashes between programs and modules

    0 讨论(0)
  • 2020-12-10 13:02

    Try this

    In Jupyter notebook first uninstall the existing numpy by using !pip uninstall numpy.

    Then install it !pip install numpy. Now restart the kernel(Python Notebook). It will work.

    0 讨论(0)
  • 2020-12-10 13:12

    Just had this issue after conda chose to update numpy from 1.13.3 to 1.14.3. Reverting numpy via procedure in http://blog.rtwilson.com/conda-revisions-letting-you-rollback-to-a-previous-version-of-your-environment/ sufficed to recover functionality, followed by pinning the version in the environment.

    0 讨论(0)
提交回复
热议问题