赞
踩
最近使用到了 fitz 库来操作 PDF 文件,如下是我的工作环境:
系统:Windows10
Python版本:Python3.9
在我的电脑上,导入 fitz 库时出现了如下报错:
ImportError: cannot import name ‘ParamSpec’ from ‘typing_extensions’ (/usr/lib/python3/dist-packages/typing_extensions.py)
另一种报错:
RuntimeError: Directory ‘static/’ does not exist
原因是Python3.8以上版本和fitz库不兼容。
卸载fitz
库
pip uninstall fitz
安装 PyMuPDF
库:
pip install -i https://mirrors.aliyun.com/pypi/simple PyMuPDF
安装好后重新导入 fitz
库:
import fitz
问题解决。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。