这可能是由于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

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

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