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

猜你喜欢

转载自blog.csdn.net/weixin_63676550/article/details/130442949