Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: __init__() missing 1 required positional argument: 'parser' #7

Open
jiashenke opened this issue Jun 18, 2020 · 0 comments
Open

Comments

@jiashenke
Copy link

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
但未找到需要修改的文件。
请老大有空的时候看下是否可以解决。谢谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant