No module named 'pandas' in Pycharm
Asked Answered
S

6

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?

Sannyasi answered 14/7, 2016 at 14:3 Comment(1)
See PyCharm: Configure a Python interpreter and click the dropdown at the top left of the page for all versions back to 2017.1.Composed
Y
29

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.

Yellowstone answered 14/7, 2016 at 18:54 Comment(4)
The OP should make sure that Anaconda is the selected interpreter. That environment will include Pandas.Huckleberry
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).Revivalist
If anyone is looking for an updated pycharm 2019 answer: jetbrains.com/help/pycharm/configuring-python-interpreter.htmlPyroligneous
I changed the interpreter to Anaconda, still I am getting the same error, no module named pandas, though it is there installed in the systemChartist
G
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

Glovsky answered 31/10, 2019 at 15:42 Comment(0)
R
1

I tried this and worked for me, I am using the last version of Pycharm. In the top right corner open Settings > Run Anything run the command: #pip_install(Select_your_Package)

pip install pandas
pip install numpy

If you run the pip install <command> in the active shell, it will be installed globally but will not work for Pycharm because Pycharm is running in a virtual environment.

Reword answered 28/4, 2024 at 19:39 Comment(0)
W
0

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

Wineshop answered 7/1, 2022 at 19:35 Comment(0)
W
0

This answer is for Windows OS-PyCharm Even though Pandas are installed and work well when executed from Python IDLE, somehow they were not visible in Pycharm. This has to do with the vm in Pycharm and libraries not visible. To resolve this issue: Open Py script in pycharm add first line of code - import pandas as pd Highlight and Right click on the word pandas in that line - Show Context Actions - Install Pandas

Warthog answered 13/1, 2024 at 0:39 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Ammonium
M
0

In PyCharm's dialog "New Project":

  1. for "Interpreter type" select "Base conda" (second toggle-button), and then
  2. click on button "Create".

Screenshot of PyCharm's dialog "New Project"

Meeting answered 19/6, 2024 at 12:21 Comment(1)
It work for me.Meeting

© 2022 - 2025 — McMap. All rights reserved.