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

声明的 PyMuPDF<1.21.0 版本兼容问题 #9340

Closed
wants to merge 2 commits into from

Conversation

izerui
Copy link

@izerui izerui commented Mar 7, 2023

https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.6/requirements.txt

官方声明的依赖项: PyMuPDF<1.21.0 ,但是PyMuPDF在 1.20以上pageCount已经改为 page_count。

@paddle-bot
Copy link

paddle-bot bot commented Mar 7, 2023

Thanks for your contribution!

@CLAassistant
Copy link

CLAassistant commented Mar 7, 2023

CLA assistant check
All committers have signed the CLA.

@izerui
Copy link
Author

izerui commented Mar 13, 2023

找到一个可以不修改paddleocr源码的方式:
import fitz 并在ocr之前调用 fitz.restore_aliases()
好让fitz恢复旧的别名映射

@xxxpsyduck
Copy link
Contributor

@izerui please sign the License Agreement first

@nashlibby
Copy link

找到一个可以不修改paddleocr源码的方式: import fitz 并在ocr之前调用 fitz.restore_aliases() 好让fitz恢复旧的别名映射

好像也不行啊,会报AttributeError: 'NoneType' object has no attribute 'copy'

@kerneltravel
Copy link
Contributor

这个问题是 pyMuPDF 1.18.14 以后引入的,官方对函数名变更的说明文档: https://github.com/pymupdf/PyMuPDF/blob/main/docs/znames.rst#deprecated-names

paddleOCR此问题的所有相关issue:https://github.com/PaddlePaddle/PaddleOCR/issues?q=is%3Aissue+ppocr%2Futils%2Futility.py

例如 #9401

@Toefinder
Copy link

@kerneltravel since you are fixing this issue, can you do a quick search in the file for any other lines using getPixmap() or pageCount()?
I see that this line in the same utility.py file is also using getPixmap()

https://github.com/PaddlePaddle/PaddleOCR/blob/2f72a55cdbaa79651e027e5a84df9ff68ea901a1/ppocr/utils/utility.py#L100C31-L100C40

@cobaltautomationdev
Copy link

最新的paddleocr 安装都安装不了,必须先安装pymupdf 1.20的,才能够顺利安装。系统是windows10.

@itasli
Copy link
Contributor

itasli commented Jan 13, 2024

#10181 fix this, PR can be closed @shiyutang

@cobaltautomationdev
Copy link

官方为何还是不更新,兼容pymupdf1.20以上的版本。

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

Successfully merging this pull request may close these issues.

10 participants