简体   繁体   中英

Module 'Tabula' not found in python spyder

I tried to run this code:

from tabula import read_pdf
df = read_pdf("../pdf/Documentacao.pdf")
print(df)

And got this:

runfile('C:/Users/Henri/git/Git/PDS1/dev/lib/planilhas01.py', wdir='C:/Users/Henri/git/Git/PDS1/dev/lib')
Traceback (most recent call last):

File "<ipython-input-4-e12a8a26bbfa>", line 1, in <module>
runfile('C:/Users/Henri/git/Git/PDS1/dev/lib/planilhas01.py', wdir='C:/Users/Henri/git/Git/PDS1/dev/lib')

File "C:\Users\Henri\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
execfile(filename, namespace)

File "C:\Users\Henri\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/Henri/git/Git/PDS1/dev/lib/planilhas01.py", line 1, in <module>
from tabula import read_pdf

ModuleNotFoundError: No module named 'tabula'

This is what my anaconda says:

(base) C:\Users\Henri>pip install tabula-py
Requirement already satisfied: tabula-py in c:\users\henri\miniconda3\lib\site-packages (1.4.1)
Requirement already satisfied: pandas in c:\users\henri\miniconda3\lib\site-packages (from tabula-py) (0.25.1)
Requirement already satisfied: distro in c:\users\henri\miniconda3\lib\site-packages (from tabula-py) (1.4.0)
Requirement already satisfied: numpy in c:\users\henri\miniconda3\lib\site-packages (from tabula-py) (1.17.2)
Requirement already satisfied: python-dateutil>=2.6.1 in c:\users\henri\miniconda3\lib\site-packages (from pandas->tabula-py) (2.8.0)
Requirement already satisfied: pytz>=2017.2 in c:\users\henri\miniconda3\lib\site-packages (from pandas->tabula-py) (2019.3)
Requirement already satisfied: six>=1.5 in c:\users\henri\miniconda3\lib\site-packages (from python-dateutil>=2.6.1->pandas->tabula-py) (1.12.0)

I think is something about directories, but what??

(base) C:\Users\Henri>pip install tabula-py Requirement already satisfied: tabula-py in c:\users\henri\miniconda3\lib\site-packages (1.4.1) I think is installed, just you need to make sure which Python environment yre installing it because maybe is installed in python3 directory, not python2.

In your anaconda prompt type: pip install tabula . Then in Spyder type import tabula .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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