简体   繁体   English

ImportError:没有名为pandas的模块[pycharm]

[英]ImportError: No module named pandas [pycharm]

I am just starting to use pycharm. 我刚刚开始使用pycharm。 I want to use tabula-py, when I try to import tabula it gives me the following error: 我想使用tabula-py,当我尝试导入tabula时,出现以下错误:

import tabula
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/Applications/PyCharm 
CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, 
in do_import
    module = self._system_import(name, *args, **kwargs)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-
packages/tabula/__init__.py", line 1, in <module>
    from .wrapper import read_pdf
  File "/Applications/PyCharm 
CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, 
in do_import
    module = self._system_import(name, *args, **kwargs)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-
packages/tabula/wrapper.py", line 17, in <module>
    import pandas as pd
  File "/Applications/PyCharm 
CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, 
in do_import
    module = self._system_import(name, *args, **kwargs)
ImportError: No module named pandas

and when i try to import pandas it's the same error. 当我尝试导入大熊猫时,这是同样的错误。 How do I fix this? 我该如何解决?

Output from pip : pip输出:

Requirement already satisfied: pandas in /Users/Rexon/Library/Python/2.7/lib/python/site-packages Requirement already satisfied: numpy>=1.9.0 in /Users/Rexon/Library/Python/2.7/lib/python/site-packages (from pandas) Requirement already satisfied: python-dateutil in /Users/Rexon/Library/Python/2.7/lib/python/site-packages (from pandas) Requirement already satisfied: pytz>=2011k in /Users/Rexon/Library/Python/2.7/lib/python/site-packages (from pandas) Requirement already satisfied: six>=1.5 in /Users/Rexon/Library/Python/2.7/lib/python/site-packages (from python) 已满足要求:/Users/Rexon/Library/Python/2.7/lib/python/site-packages中的熊猫已满足要求:/Users/Rexon/Library/Python/2.7/lib/python/中的numpy> = 1.9.0 site-packages(来自pandas)已满足要求:/Users/Rexon/Library/Python/2.7/lib/python/site-packages(来自pandas)中的python-dateutil已满足要求:/ Users / Rexon中的pytz> = 2011k /Library/Python/2.7/lib/python/site-packages(来自熊猫)已满足要求:/Users/Rexon/Library/Python/2.7/lib/python/site-packages中的六个> = 1.5(来自python)

Your error says 你的错误说

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site- packages

But your pip says 但是你的点子说

/Users/Rexon/Library/Python/2.7/lib/python/site-packages

Make sure your terminal and pycharm use the same python path. 确保您的终端和pycharm使用相同的python路径。

In Pycharm, go to preferences, and then project interpreter and click the '+' button to add the library to your project interpreter. 在Pycharm中,转到首选项,然后转到项目解释器,然后单击“ +”按钮将库添加到您的项目解释器。

Your project $PYTHONPATH environment variable does not include the directory that pip installed your module to. 您的项目$ PYTHONPATH环境变量不包括pip将模块安装到的目录。

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

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