vscode启动Python调试 找不到指定模块
vscode在启动python调试时,要导入numpy模块,而且非常确定numpy已经安装了,但还是提示找到numpy模块Exception has occurred: ImportErrorIMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!Importing the numpy C-extensions faile
·
vscode在启动python调试时,要导入numpy模块,而且非常确定numpy已经安装了,但还是提示找到numpy模块
Exception has occurred: 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 "C:\Users\haijun.zhang1\Anaconda3\python.exe"
* The NumPy version is: "1.20.1"
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: 找不到指定的模块。
按照网上说的方法,在setting.json中设置了Python的路径,
在launch.json中设置了env
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: 当前文件",
"type": "python",
"request": "launch",
"stopOnEntry": false,
"program": "${file}",
"pythonPath": "${command:python.interpreterPath}",
"cwd": "${workspaceRoot}",
"env": {"PYTHONPATH":"${workspaceRoot}"},
"envFile": "${workspaceRoot}/.env",
"console": "integratedTerminal"
}
]
}
但还是不行。
最终解决方法,启动Anaconda Prompt,通过cd
指令切换到vscode的目录下,输入code .
来启动vscode,就可以正常调试了。
欢迎关注微信公众号:Quant_Times
更多推荐
已为社区贡献1条内容
所有评论(0)