VSCode scipy导入报错 scipy - ImportError: DLL load failed: The specified module could not be found.

博客讲述了在VSCode中遇到scipy导入错误的问题,问题表现为ImportError: DLL load failed: The specified module could not be found。尽管在PyCharm中代码运行正常。解决方案是通过重新安装scipy,并使用国内镜像源,如豆瓣镜像,以避免下载失败。此问题的解决对于VSCode用户和Python开发者具有一定的参考价值。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

VSCode scipy导入报错 scipy - ImportError: DLL load failed: The specified module could not be found.

源代码:

import pandas as pd
from scipy import stats

在PyCharm中运行没问题。但在VScode中,pandas 导入没问题,但是scipy导入失败。
找了许多办法,最后在 https://github.com/conda/conda/issues/6396 中找到了解决办法。

解决办法:
重装scipy

pip install scipy --force-reinstall -i http://pypi.douban.com/simple/

注意需要使用国内的镜像,否则会下载失败。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值