[英]Pandas not found in Visual Studio Code even though it is definitely in the env
I am running Visual Studio Code on two machines, both set up essentially the same way.我在两台机器上运行 Visual Studio Code,两者的设置方式基本相同。 One is an iMac, the other a MacBook Air.一个是 iMac,另一个是 MacBook Air。 In one of my projects, on the iMac, it doesn't recognize that pandas is installed, even though it is in the environment.在我的一个项目中,在 iMac 上,它无法识别 pandas 已安装,即使它在环境中也是如此。
Here is the VSC python interpreter selection:这是 VSC python 解释器选择:
And here you can see that:在这里你可以看到:
I've tried uninstalling pandas and reinstalling it, but that doesn't help.我试过卸载 pandas 并重新安装它,但这没有帮助。 I've tried making sure it's in the non-env python install (it is), but that doesn't help.我试过确保它在非环境 python 安装中(它是),但这没有帮助。
I have other projects on the same computer set up essentially the same way, and pandas works fine.我在同一台计算机上的其他项目的设置方式基本相同,并且 pandas 工作正常。 I also have the same project on my laptop, with the same setup, and it is working there too.我的笔记本电脑上也有相同的项目,具有相同的设置,它也在那里工作。 I'm kinda stumped.我有点难过。 I guess I'll be working on it on the laptop for now, but I'd appreciate any insight people may have...我想我现在会在笔记本电脑上处理它,但我会很感激人们可能有任何见解......
import pip
pip.main(["freeze"])
Thank you!谢谢! Dylan迪伦
According to your description, it is command that you could refer to the following steps:根据您的描述,可以参考以下步骤的命令:
Enter the current virtual environment in VSCode.在 VSCode 中输入当前的虚拟环境。
Enter ' pip --version
' to check if the pip currently used is from the current environment: (This ensures that using pip to install pandas module will be put into the current virtual environment.) Enter ' pip --version
' to check if the pip currently used is from the current environment: (This ensures that using pip to install pandas module will be put into the current virtual environment.)
After installation:(I use the command ' pip install pandas
'(windows10), mac: pip3 install pandas
)安装后:(我使用命令' pip install pandas
'(windows10), mac: pip3 install pandas
)
If it still has wavy lines, try reloading vscode.( Ctrl+Shift+p
, Developer: Reload windows
).如果它仍然有波浪线,请尝试重新加载 vscode。( Ctrl+Shift+p
, Developer: Reload windows
)。 The module pandas can be used:模块 pandas 可以使用:
Check the installation package:检查安装package:
If the pip list shows the pands module, but we still can't use it, we can find the current virtual environment folder and check whether there is pandas installation package:如果pip列表显示了pands模块,但还是不能使用,可以找到当前虚拟环境文件夹,查看是否有pandas安装ZEFE90A8E604A7C840E88D03A67F6B7D8:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.