Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't import pandas into pycharm interpreter, despite changing pyCharm python interpreter path

I'm trying to import pandas in the pyCharm python interpreter, but I keep on getting the dreaded

>>> import pandas
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
ImportError: No module named pandas

It works fine when I run python from the terminal. I've read up on solutions for this, but none have worked so far. I've pip uninstalled, reinstalled, and updated pandas. I've changed the pyCharm project python interpreter and default pyCharm python interpreter to be "2.7.5 (/usr/local/bin/python)", so that now:

>>> os.system('which python')
/usr/local/bin/python

occurs in the pycharm interpreter and terminal python interpreter.

Any more ideas on how to fix this?

Thanks

like image 720
Hillary Sanders Avatar asked Feb 21 '15 01:02

Hillary Sanders


2 Answers

Turns out, changing my terminal shell path in pyCharms settings (In the menu bar, pyCharm --> Preferences --> tools --> terminal --> Shell Path) to the correct thing:

> echo $PATH # whatever this spits out in terminal is your shell path

fixed everything :)

like image 164
Hillary Sanders Avatar answered Oct 17 '22 16:10

Hillary Sanders


I changed the project interpreter under PyCharm -> Preferences -> Project -> Project Interpreter to the one that that of my system uses. I had 2.6 and 2.7 in the system and PyCharm was using 2.6 by default. Changed it to 2.7 which is what the Terminal was using. Problem solved.

like image 41
dushshantha Avatar answered Oct 17 '22 15:10

dushshantha