vscode anaconda 环境 出现importError 解决方法
Importing the numpy C-extensions failed.
问题描述
During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "D:\Anaconda3\lib\site-packages\numpy\__init__.py", line 142, in <module> from . import core File "D:\Anaconda3\lib\site-packages\numpy\core\__init__.py", line 50, in <module> raise ImportError(msg) ImportError: IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE! Importing the numpy C-extensions failed. This error can happen for many reasons, often due to issues with your setup or how NumPy was installed. We have compiled some common reasons and troubleshooting tips at: https://numpy.org/devdocs/user/troubleshooting-importerror.html Please note and check the following: * The Python version is: Python3.8 from "D:\Anaconda3\python.exe" * The NumPy version is: "1.18.5" and make sure that they are the versions you expect. Please carefully study the documentation linked above for further help. Original error was: DLL load failed while importing _multiarray_umath: 找不到指定的模块。
看到了很多解决方法,有一些是无效的,有的要修改vscode settings.json文件的"terminal.integrated.shell.windows": “C:\WINDOWS\System32\cmd.exe”,
最后找到了一种感觉最好的方案:
pip install --upgrade numpy