17

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

Pycharm version: 2016.1.4

Python version: 2.7.10

Pandas version: 0.18.1

Pandas works in Anaconda, in Jupyter too. How to fix the problem?

desertnaut
  • 57,590
  • 26
  • 140
  • 166
ElenaPhys
  • 443
  • 2
  • 5
  • 16
  • See [PyCharm: Configure a Python interpreter](https://www.jetbrains.com/help/pycharm/configuring-python-interpreter.html) and click the dropdown at the top left of the page for all versions back to 2017.1. – Trenton McKinney Aug 03 '22 at 21:50

4 Answers4

27

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

follow this link, check whether pandas listed in the packages.

Scott Boston
  • 147,308
  • 15
  • 139
  • 187
Lisa
  • 4,126
  • 12
  • 42
  • 71
  • 4
    The OP should make sure that Anaconda is the selected interpreter. That environment will include Pandas. – andrew Jul 14 '16 at 19:00
  • 1
    Works a treat: From the PyCharm menu system: File -> Settings Project: YourProjectName -> Project Interpreter -> Select from the drop down list and choose Anaconda and click OK. (It may take a few moments to update in background). – GBGOLC Sep 07 '17 at 14:46
  • If anyone is looking for an updated pycharm 2019 answer: https://www.jetbrains.com/help/pycharm/configuring-python-interpreter.html – srboisvert Nov 27 '19 at 19:57
  • I changed the interpreter to Anaconda, still I am getting the same error, no module named pandas, though it is there installed in the system – Vikramaditya Nov 15 '22 at 00:38
2

you can add a new project interpreter if you are using PyCharm ( IDE) . I install Anaconda first.

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 )

add new project interpreter - Anaconda3/python.exe

add new project interpreter - Anaconda3/python.exe

M_S_N
  • 2,764
  • 1
  • 17
  • 38
Mitchell
  • 75
  • 2
0

YOu are missing the libraries / Packages should be included in your project interpreter. add the libraries there all will be fine.

Muhammad Usama
  • 167
  • 1
  • 3
0

For me the solution was to delete some __init__.py files in sub folders, e.g. src/site/__init__.py

Stefan
  • 10,010
  • 7
  • 61
  • 117