简体   繁体   English

尽管改变了pyCharm python解释器路径,但无法将pandas导入pycharm解释器

[英]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 我正在尝试在pyCharm python解释器中导入pandas,但我一直在变得可怕

>>> 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. 当我从终端运行python时它工作正常。 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: 我已经将pyCharm项目的python解释器和默认的pyCharm python解释器更改为“2.7.5(/ usr / local / bin / python)”,所以现在:

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

occurs in the pycharm interpreter and terminal python interpreter. 发生在pycharm解释器和终端python解释器中。

Any more ideas on how to fix this? 有关如何解决此问题的更多想法?

Thanks 谢谢

Turns out, changing my terminal shell path in pyCharms settings (In the menu bar, pyCharm --> Preferences --> tools --> terminal --> Shell Path) to the correct thing: 事实证明,在pyCharms设置(在菜单栏中,pyCharm - >首选项 - >工具 - >终端 - > Shell路径)中更改我的终端shell路径到正确的事情:

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

fixed everything :) 固定一切:)

I changed the project interpreter under PyCharm -> Preferences -> Project -> Project Interpreter to the one that that of my system uses. 我将PyCharm - > Preferences - > Project - > Project Interpreter下的项目解释器更改为我系统使用的项目解释器。 I had 2.6 and 2.7 in the system and PyCharm was using 2.6 by default. 系统中有2.6和2.7,PyCharm默认使用2.6。 Changed it to 2.7 which is what the Terminal was using. 将其更改为2.7,即终端正在使用的内容。 Problem solved. 问题解决了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM