Reputation: 451
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?
Upvotes: 17
Views: 118190
Reputation: 1
In PyCharm's dialog "New Project":
Upvotes: 0
Reputation: 21
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.
Upvotes: 2
Reputation: 1
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
Upvotes: 0
Reputation: 12260
For me the solution was to delete some __init__.py files in sub folders, e.g. src/site/__init__.py
Upvotes: 0
Reputation: 4416
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.
Upvotes: 30
Reputation: 71
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
Upvotes: 2