简体   繁体   English

Pycharm 中没有名为“pandas”的模块

[英]No module named 'pandas' in Pycharm

I read all the topics about, but I cannot solve my problem:我阅读了有关的所有主题,但无法解决我的问题:

 Traceback (most recent call last):
 File "/home/.../.../.../reading_data.py", line 1, in <module>
 import pandas as pd
 ImportError: No module named pandas     

This is my environment:这是我的环境:

Ubuntu 14.04 Ubuntu 14.04

Pycharm version: 2016.1.4 Pycharm 版本:2016.1.4

Python version: 2.7.10 Python 版本:2.7.10

Pandas version: 0.18.1 Pandas 版本:0.18.1

Pandas works in Anaconda, in Jupyter too. Pandas 在 Anaconda 中工作,也在 Jupyter 中工作。 How to fix the problem?如何解决问题?

Have you select the project interpreter for your current project?您是否为当前项目选择了项目解释器? https://www.jetbrains.com/help/pycharm/2016.1/configuring-python-interpreter-for-a-project.html https://www.jetbrains.com/help/pycharm/2016.1/configuring-python-interpreter-for-a-project.html

follow this link, check whether pandas listed in the packages.按照此链接,检查包中是否列出了熊猫。

you can add a new project interpreter if you are using PyCharm ( IDE) .如果您使用的是 PyCharm (IDE),您可以添加一个新的项目解释器。 I install Anaconda first.我先安装 Anaconda。

1) go to File and click on Setting 2) go to project XXX ( right below Version Control) 3) click project interpreter 4) click the top right button ( lined up with project interpreter ) 1)转到文件并单击设置 2)转到项目XXX(版本控制正下方) 3)单击项目解释器 4)单击右上角的按钮(与项目解释器对齐)

add new project interpreter - Anaconda3/python.exe添加新的项目解释器 - Anaconda3/python.exe

add new project interpreter - Anaconda3/python.exe添加新的项目解释器 - Anaconda3/python.exe

YOu are missing the libraries / Packages should be included in your project interpreter.您缺少项目解释器中应包含的库/包。 add the libraries there all will be fine.添加库那里一切都会好起来的。

对我来说,解决方案是删除子文件夹中的一些 __init__.py 文件,例如 src/site/__init__.py

Pip install inyour pycharm terminal Pip 安装在您的 pycharm 终端中

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

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