0
votes

I am just starting to use pycharm. I want to use tabula-py, when I try to import tabula it gives me the following error:

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:

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)

2
Have you tried pip install pandas?Peter
Yes it says "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 pythonRexon

2 Answers

2
votes

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.

0
votes

In Pycharm, go to preferences, and then project interpreter and click the '+' button to add the library to your project interpreter.

Your project $PYTHONPATH environment variable does not include the directory that pip installed your module to.