在执行pip install paddleocr
时,我遇到了一个构建PyMuPDF wheel的错误。
Building wheels for collected packages: PyMuPDF
Building wheel for PyMuPDF (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [70 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\3551\AppData\Local\Temp\pip-install-ip72hta1\pymupdf_f7a2c6bc313a492fa6c66ad0817a4616\setup.py", line 487, in <module>
mupdf_local = get_mupdf()
^^^^^^^^^^^
File "C:\Users\3551\AppData\Local\Temp\pip-install-ip72hta1\pymupdf_f7a2c6bc313a492fa6c66ad0817a4616\setup.py", line 450, in get_mupdf
return tar_extract( mupdf_tgz, exists='return')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\3551\AppData\Local\Temp\pip-install-ip72hta1\pymupdf_f7a2c6bc313a492fa6c66ad0817a4616\setup.py", line 183, in tar_extract
t.extractall()
File "C:\Users\3551\AppData\Local\Programs\Python\Python311\Lib\tarfile.py", line 2059, in extractall
self.extract(tarinfo, path, set_attrs=not tarinfo.isdir(),
File "C:\Users\3551\AppData\Local\Programs\Python\Python311\Lib\tarfile.py", line 2100, in extract
self._extract_member(tarinfo, os.path.join(path, tarinfo.name),
File "C:\Users\3551\AppData\Local\Programs\Python\Python311\Lib\tarfile.py", line 2173, in _extract_member
self.makefile(tarinfo, targetpath)
File "C:\Users\3551\AppData\Local\Programs\Python\Python311\Lib\tarfile.py", line 2214, in makefile
with bltn_open(targetpath, "wb") as target:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '.\\mupdf-1.20.3-source\\thirdparty\\harfbuzz\\test\\shaping\\texts\\in-house\\shaper-indic\\script-devanagari\\utrrs\\codepoint\\IndicFontFeatureCodepoint-AdditionalConsonants.txt'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for PyMuPDF
Running setup.py clean for PyMuPDF
Failed to build PyMuPDF
ERROR: Could not build wheels for PyMuPDF, which is required to install pyproject.toml-based projects
我尝试使用 pip install wheel
命令安装 PyMuPDF,然后使用 pip install PyMuPDF
安装 paddleocr,但是出现了相同的问题,即在构建 PyMuPDF 的 wheel 文件时出错。
我的电脑是 intel i3, 64
位处理器,Python 版本为 3.11.3
。
paddleocr
的要求是PyMuPDF<1.21.0
和PyMuPDF==1.20.2
(符合paddleocr
要求的最新版本)。而PyMuPDF==1.20.2
只有适用于Python 3.10的whl文件。 - undefined