栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

vscode import numpy 失败:DLL load failed

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

vscode import numpy 失败:DLL load failed

vscode & anaconda import numpy 失败:DLL load failed

现象:
anaconda prompt中,import numpy正常
vscode中,import numpy报错:DLL load failed

错误原因:
shell 打开失败,导致 conda activate 失败,没有环境,自然没有 numpy

解决:
打开vscodesettings.json文件

(type)               CTRL + SHIFT + P
(search for:)        open settings
(click:)             Preferences: Open Settings (JSON)

在 settings.json 中加入:

	"terminal.integrated.profiles.windows":{
        "PowerShell": {
            "source": "PowerShell",
            "icon": "terminal-powershell"
        },
        "Command prompt": {
            "path": [
                "${env:windir}\Sysnative\cmd.exe",
                "${env:windir}\System32\cmd.exe"
            ],
            "args": [],
            "icon": "terminal-cmd"
        },
        "Git Bash": {
            "source": "Git Bash"
        }
    },
    "terminal.integrated.defaultProfile.windows":"Command prompt" 

另外还参考了另外的一个博客,需要配置环境变量
将以下内容分别放入 此电脑->属性->高级系统设置->环境变量->path路径中:

D:anaconda
D:anacondascripts
D:anacondaLibrarybin
D:anacondaLibraryuserbin
D:anacondaLibrarymingw-w64bin

参考网站:
https://blog.csdn.net/zhaoyin214/article/details/105274503
https://blog.csdn.net/weixin_44138265/article/details/120319345?spm=1001.2101.3001.6650.3&utm_medium=distribute.pc_relevant.none-task-blog-2~default~CTRLIST~default-3.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2~default~CTRLIST~default-3.no_search_link
https://www.codeleading.com/article/87943815852/

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/461383.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号