AttributeError: ‘Document‘ object has no attribute ‘pageCount‘ PyMuPDF库

这可能是由于PyMuPDF库更新导致的,里面的一些函数名发生了变化

 

1. AttributeError: ‘Document’ object has no attribute ‘pageCount’

将  pageCount改为 page_count

2. AttributeError: ‘Matrix’ object has no attribute ‘preRotate’

将preRotate改为prerotate

3.AttributeError: ‘Page’ object has no attribute ‘getPixmap’

将getPixmap改为get_pixmap

4. AttributeError: ‘Pixmap’ object has no attribute ‘writePNG’

将writePNG改为_writeIMG

e2c04cb57d4a419b8b61ab69c87fb84b.png

 

或者直接安装老版本的这个库,也能解决一切问题

pip install PyMuPDF==1.19.0 -i https://pypi.tuna.tsinghua.edu.cn/simple

 

 

 

本文来自网络,不代表协通编程立场,如若转载,请注明出处:https://net2asp.com/aa462fe4bb.html