Python Pandas - Missing required dependencies ['numpy'] 1

前端 未结 28 2180
清歌不尽
清歌不尽 2020-11-27 16:32

Since yesterday I\'ve had this error when I try to import packages on anaconda :

ImportError: Missing required dependencies [\'numpy\']

I have t

相关标签:
28条回答
  • 2020-11-27 17:05

    The following worked for me. Deleted the folders for numpy and pandas together with their contents completely from the site-packages folder. Check depending on whether you are using python2 or python3. Check the exact path as per your machine.


    N.B handle with care "rm -rf" command. If you are not sure of what you are doing, please do it manually using any file explorer of your choice!!

    1. rm -rf ~/anaconda2/envs/myenv/lib/pythonX/site-packages/pandas*

    2. rm -rf ~/anaconda2/envs/myenv/lib/pythonX/site-packages/numpy*

    Then i installed clean packages for pandas and numpy as usual with

    • pip install numpy
    • pip install pandas
    0 讨论(0)
  • 2020-11-27 17:06

    I was trying to upgrade my anaconda 2 with anaconda 3. I tried installing Anaconda3-2018.12-Windows-x86 and Anaconda3-2019.03-Windows-x86_64 on my Windows 10 machine and failed with this error. For me, using Anaconda3-4.4.0-Windows-x86_64 for anaconda 3 worked the trick after trying everything listed in answers here.

    0 讨论(0)
  • 2020-11-27 17:10

    I fixed this using Anaconda by going to Environments > base(root), searching for numpy in the installed modules and clicking the tickbox alongside it and choosing > Mark for specific version installation > 1.14.0 (as suggested by another user on this thread). Then clicking Apply. Once it downgraded numpy I stopped getting errors when running py files on the command line.

    Throughout this saga, I was still able to use https://pypi.org/project/auto-py-to-exe/ even when I was getting the numpy errors on the command line, but it was a hassle to create an exe every time I wanted to test a change. It's all sorted now. I guess there was a problem with numpy 1.16.4.

    Anyway, I hope this helps someone who's using Anaconda as well.

    0 讨论(0)
  • 2020-11-27 17:10

    I've got the same error recently.
    Before applying uninstall or install tools, try to update your Jupyter.

    How? Go to 'Environments' and type on the Search Packages box 'pandas'.
    Afterwards, check the version (if that column shows a blue number with a diagonal arrow, it means that your pandas is out of date).
    Click on 'pandas' and a option will pop up (choose 'Apply' and wait for a couple of minutes to update the package).
    And then, make a quick test on any notebook to make sure that your Jupyter is running smoothly.

    0 讨论(0)
  • 2020-11-27 17:11

    I have same problem. I have got two version of numpy 1.16.6 and 1.15.4, fresh installed pandas did not work correctly. I fixed it by uninstalling all versions of numpy and pandas and install the last versions.

    $ pip uninstall  numpy pandas -y
    Uninstalling numpy-1.16.6:
      Successfully uninstalled numpy-1.16.6
    Uninstalling pandas-0.24.2:
      Successfully uninstalled pandas-0.24.2
    $ pip uninstall  numpy pandas -y
    Uninstalling numpy-1.15.4:
      Successfully uninstalled numpy-1.15.4
    Cannot uninstall requirement pandas, not installed
    $ pip uninstall  numpy pandas -y
    Cannot uninstall requirement numpy, not installed
    $ pip install  numpy pandas
    
    0 讨论(0)
  • 2020-11-27 17:13

    First, try to import numpy on it's own, like so:

    import numpy as np
    

    I got this message:

    ImportError: Something is wrong with the numpy installation. While importing 
    we detected an older version of numpy in 
    ['/home/michael/.local/lib/python3.6/site-packages/numpy']. One method of 
    fixing this is to repeatedly uninstall numpy until none is found, then 
    reinstall this version.
    

    So do what it says, keep uninstalling numpy until there is none, and then reinstall.

    This worked for me.

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