当前位置:   article > 正文

python 导入错误 ImportError: Unable to import required dependencies: numpy_and make sure that they are the versions you expec

and make sure that they are the versions you expect. please carefully study

报错信息:

  1. ImportError: Unable to import required dependencies:
  2. numpy:
  3. IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
  4. Importing the numpy C-extensions failed. This error can happen for
  5. many reasons, often due to issues with your setup or how NumPy was
  6. installed.
  7. We have compiled some common reasons and troubleshooting tips at:
  8. https://numpy.org/devdocs/user/troubleshooting-importerror.html
  9. Please note and check the following:
  10. * The Python version is: Python3.8 from "E:\ProgramData\Anaconda3\python.exe"
  11. * The NumPy version is: "1.19.2"
  12. and make sure that they are the versions you expect.
  13. Please carefully study the documentation linked above for further help.
  14. Original error was: DLL load failed while importing _multiarray_umath: 找不到指定的模块。

报错提示其实很明显了:

The Python version is Python3.8
The Numpy version is 1.19.1

python 和 numpy 的版本不匹配。

报错原因分析:

anaconda自己安的numpy是1.19,python是3.8。两个版本不匹配,3.8应该对应1.18.2。

所以解决方案是卸载1.19安装1.18.2

解决方案:

  1. 打开Anaconda Prompt的命令行窗口
  2. 输入 pip uninstall numpy。 卸载 numpy 1.19
  3. pip install numpy==1.18.2。 安装numpy 1.18.2
  4. 成功后关闭Anaconda Prompt的命令行窗口再重新打开即可

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/272095
推荐阅读
相关标签
  

闽ICP备14008679号