我正在尝试使用Tabula-py读取PDF文件。我通过pip install tabula-py
安装了tabula-py。
我还安装了所需的依赖项。
requests
pandas
pytest
flake8
我的代码目前如下:
import tabula
import pandas as pd
df = tabula.read_pdf("report.pdf", pages=2)
print(df)
我遇到了以下错误:
Traceback (most recent call last):
File "tabula_pdf_reader.py", line 1, in <module>
import tabula
ImportError: No module named tabula
有什么意见或建议吗?
import
语句上出现了错误。这意味着解释器认为你没有安装它,与你的观点不一致。 - BoarGulespip install tabula-py
给出了Requirement already satisfied: tabula-py in /usr/local/lib/python2.7/site-packages
,因此我认为它已经正确安装了? - AgentXwhich python
命令验证了这一点,结果为/usr/bin/python
,然后我检查了版本号,使用命令/usr/bin/python -version
,结果显示为2.7。 - AgentX