简体   繁体   English

无法在 Pycharm 中导入大熊猫

[英]Can't import pandas in Pycharm

I'm running python3.6 in a conda enviroment, pandas is installed.我在 conda 环境中运行 python3.6,安装了熊猫。 I run my code in terminal and it works, but when I run it in pycharm it shows:我在终端中运行我的代码并且它可以工作,但是当我在 pycharm 中运行它时它显示:

>  import pandas as pd ModuleNotFoundError: No module named 'pandas'

I checked my interpreter, checked the packages installed, AND PANDAS IS THERE!, but I don't know why it is not recognizing it.我检查了我的解释器,检查了安装的软件包,PANDAS 在那里!,但我不知道为什么它不能识别它。

安装的软件包

Pycharm has many configuration, which can be a bit confusing at first. Pycharm 有很多配置,一开始可能会有点混乱。

First of all there are the interpreters configured in your environment, like the one you set up in your question.首先,在您的环境中配置了解释器,就像您在问题中设置的那样。

Secondly there are specific configurations for running your application, you can create many run configurations for you project in order to run different files/modules with different interpreters (for example run the project with python3 project specific venv, and your tests using pytest interpreter) as explained here其次有用于运行您的应用程序的特定配置,您可以为您的项目创建许多运行配置,以便使用不同的解释器运行不同的文件/模块(例如,使用 python3 项目特定的 venv 运行项目,并使用 pytest 解释器运行您的测试) 作为在这里解释

I think you didn't set the run/debug configurations to use this specific interpreter, or accidentally created a project venv that doesn't contains pandas yet.我认为你没有设置运行/调试配置来使用这个特定的解释器,或者不小心创建了一个不包含熊猫的项目venv

By the way, it is very recommended to create project specific venv as explained here顺便说一句,非常建议按照此处的说明创建项目特定的 venv

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

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