小编Sai*_*yuz的帖子

Camelot:DeprecationError:PdfFileReader 已弃用

我一直在我们的项目中使用camelot,但是自两天以来我收到了以下错误消息。当尝试运行以下代码片段时:

import camelot
tables = camelot.read_pdf('C:\\Users\\user\\Downloads\\foo.pdf', pages='1')
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

DeprecationError: PdfFileReader is deprecated and was removed in PyPDF2 3.0.0. Use PdfReader instead.
Run Code Online (Sandbox Code Playgroud)

我检查了这个文件,它确实使用 pdfFileReader: c:\ProgramData\Anaconda3\lib\site-packages\camelot\handlers.py

我以为我可以指定PyPDF2的版本,但是当我安装camelot时它会自动安装(因为该库是camelot使用的)。您认为有什么解决方案可以手动指定PyPDF2的版本吗?

python pypdf python-camelot

20
推荐指数
1
解决办法
6万
查看次数

标签 统计

pypdf ×1

python ×1

python-camelot ×1