You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[2020-06-18 09:12:06] -> 开始翻译Risk-Based Management and Monitoring of Clinical Trials.pdf
Traceback (most recent call last):
File "main.py", line 124, in
run()
File "main.py", line 50, in run
translate_doc(doc)
File "main.py", line 64, in translate_doc
translate.translate()
File "E:\TranslateTool\T_Pdf_pdfminer.py", line 64, in translate
doc_pdf = PDFDocument()
TypeError: init() missing 1 required positional argument: 'parser'
1、先出现这个问题
Error: cannot import name 'PDFDocument' from 'pdfminer.pdfparser'
查询 :https://stackoverflow.com/questions/56023686/error-cannot-import-name-pdfdocument-from-pdfminer-pdfparser
后解决。
from pdfminer.pdfparser import PDFParser, PDFDocument
修改为
from pdfminer.pdfparser import PDFParser
from pdfminer.pdfdocument import PDFDocument
from pdfminer.pdfpage import PDFPage
2、又遇到这个问题
E:\TranslateTool>python main.py
[2020-06-18 09:12:06] -> 提取到 1 个文档
[2020-06-18 09:12:06] -> 开始翻译Risk-Based Management and Monitoring of Clinical Trials.pdf
Traceback (most recent call last):
File "main.py", line 124, in
run()
File "main.py", line 50, in run
translate_doc(doc)
File "main.py", line 64, in translate_doc
translate.translate()
File "E:\TranslateTool\T_Pdf_pdfminer.py", line 64, in translate
doc_pdf = PDFDocument()
TypeError: init() missing 1 required positional argument: 'parser'
仅在翻译PDF的时候出现以上信息。这个问题 查找了很多资料,目前无法解决,
有介绍:https://stackoverflow.com/questions/61866149/typeerror-init-missing-1-required-positional-argument-parser-in-slate3
但未找到需要修改的文件。
请老大有空的时候看下是否可以解决。谢谢!
The text was updated successfully, but these errors were encountered: