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

前端 未结 28 2361
清歌不尽
清歌不尽 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 16:51

    On Windows 10 Anaconda3-5.3.0-Windows-x86_64 I had the Missing required dependencies ['numpy'] error when running scripts as so, %HOMEPATH%\AppData\Local\Continuum\anaconda3\python.exe pandas_script_foo.py.

    In my case the error was caused by missing Anaconda package PATH definitions when running Anaconda python.exe in a windows cmd.exe session. The numpy package is not missing. It just can't be found on the PATH.

    The Anaconda installation includes windows shortcuts that give examples of configuring the PATH per script run. See the shortcuts in the %HOMEPATH%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Anaconda3 (64-bit) directory for examples. See the %HOMEPATH%\AppData\Local\Continuum\anaconda3\cwp.py script to see how Anaconda configures PATH.

    Below is an example windows BAT file that calls cwp.py to setup PATH, and then run a python script. Its a copy of the commands the Anaconda jupyter-lab shortcut executes.

    %HOMEPATH%\AppData\Local\Continuum\anaconda3\python.exe ^
    %HOMEPATH%\AppData\Local\Continuum\anaconda3\cwp.py ^
    %HOMEPATH%\AppData\Local\Continuum\anaconda3 ^
    %HOMEPATH%\AppData\Local\Continuum\anaconda3\python.exe ^
    %HOMEPATH%\AppData\Local\Continuum\anaconda3\Scripts\jupyter-lab-script.py
    

    If you need to execute python scripts on Anaconda with the conveniance of running a BAT file, the above BAT file example should do the trick.

    0 讨论(0)
  • 2020-11-27 16:52

    I had this same issue immediately after upgrading pandas to 0.19.2. I fixed it with the following install/uninstall sequence from the windows cmd line:

    pip uninstall pandas -y
    pip uninstall numpy -y
    pip install pandas
    pip install numpy
    

    This also broke my matplotlib install so I uninstalled/installed that as well.

    Very odd behavior for a seemingly routine upgrade.

    0 讨论(0)
  • 2020-11-27 16:53

    build_exe_options = {"packages": ["os",'pandas','numpy']}

    It works.

    0 讨论(0)
  • 2020-11-27 16:54

    I also faced the same issue. It happened to me after I upgraded my numpy library. It was resolved in my case by upgrading my pandas library as well after upgrading my numpy library using the below command:

    pip install --upgrade pandas
    
    0 讨论(0)
  • 2020-11-27 16:54

    nothing worked for me ... except when I found this

    I suspect that you have a local file called unittest.py that is getting imported instead of the standard module.
    
    0 讨论(0)
  • 2020-11-27 16:55

    I had the same issue with anaconda package, it got updated.

    anaconda  {4.3.1 -> custom} ## I am not sure if this was the issue
    

    Hit below command to know

    conda list --revisions
    

    what i did is just uninstall pandas with conda and re-install it

    conda install pandas
    

    Some new libs may also get installed with it.

    It worked for me hope will do the same for you.

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