简体   繁体   中英

Can't import pandas in Pycharm

I'm running python3.6 in a conda enviroment, pandas is installed. I run my code in terminal and it works, but when I run it in pycharm it shows:

>  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.

安装的软件包

Pycharm has many configuration, which can be a bit confusing at first.

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

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.

By the way, it is very recommended to create project specific venv as explained here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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