繁体   English   中英

Python 模块已安装也找不到

[英]Python Module Can Not be Found Even Though It Is Installed

I used python and pandas so many times in VS Code but It causes a problem right know: problem The terminal looks like this: terminal and I checked if matplotlib is installed or not but seems like it is installed matplotlib check . 我不知道为什么会这样,但它一直工作到现在。

原因是你目前在VS Code中使用的python环境与VS Code终端使用的python环境不同。

解决方法:请关闭当前使用的VS Code终端(点击“Kill Terminal”图标),然后在VS Code左下方selectpython环境下安装所需模块,然后使用快捷键Ctrl+Shift+`打开新的 VS Code 终端。

此外,我注意到您使用的是 powershell 终端。 如果你使用的是虚拟环境或者conda环境,我们需要在终端中激活这个环境(一般打开新终端时会自动激活):

在此处输入图像描述

检查模块:

在此处输入图像描述

跑:

在此处输入图像描述

参考: 在 VS Code 中使用 Python 环境

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM