Hillary Sanders Hillary Sanders - 9 months ago 94
Python Question

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')

occurs in the pycharm interpreter and terminal python interpreter.

Any more ideas on how to fix this?



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 :)