windows安装PaddleOCR常见报错

一、Could not build wheels for PyMuPDF

执行命令:pip install paddleocr -i https://mirror.baidu.com/pypi/simple

错误信息

      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
  Building wheel for future (setup.py) ... done
  Created wheel for future: filename=future-0.18.3-py3-none-any.whl size=492054 sha256=3c7aa66260602f167dcab34e425d4799c7b8f4f98e411aa46164213b13f008d8
  Stored in directory: c:\users\fbbao\appdata\local\pip\cache\wheels\e4\f1\c4\edaf3b3c11ec1de79728d137d9e6e5facabc48cd2eaf16d792
Successfully built fire future
Failed to build PyMuPDF
ERROR: Could not build wheels for PyMuPDF, which is required to install pyproject.toml-based projects

安装PyMuPDF:
pip install PyMuPDF -i https://pypi.tuna.tsinghua.edu.cn/simple

安装完成后依然报错

原因:

python版本太高,我用的3.11的报错,可以降低到3.9就可以了

解决方法:

第一种:
安装paddleocr 的时候 指定PyMuPDF版本
可以试试这行 pip install “paddleocr>=2.0.1” --upgrade PyMuPDF==1.23.26
注意PyMuPDF版本是自己安装的版本

第二种:
降低python版本到3.9

二、The aliases was originally deprecated in NumPy 1.20

执行:paddleocr --image_dir D:\work\idcard.jpeg --use_angle_cls true --use_gpu false

报错信息

File "D:\install\anaconda\envs\paddle_env2\Lib\site-packages\numpy\__init__.py", line 338, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'int'.
`np.int` was a deprecated alias for the builtin `int`. To avoid this error in existing code, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'inf'?

解决方法

是将您的numpy版本修复到仍然支持使用 np.object 的最后一个版本1.23.4
pip install numpy==1.23.4

ModuleNotFoundError: No module named ‘patch_ng’

确认正确安装了pip工具
pip --version
如果返回pip的版本信息,则表示pip已正确安装。如果未安装,请根据所使用的操作系统和Python版本进行安装。

升级pip工具
python -m pip install --upgrade pip

更新pip和setuptools工具
pip install -U pip setuptools

使用国内源
中国大陆地区用户可以尝试使用国内源来安装paddleocr。可以使用以下命令来更改pip源为国内源:
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

检查patch_ng模块
确保 patch_ng 模块已正确安装。您可以通过以下命令检查
pip show patch_ng

手动安装patch-ng模块
pip install patch_ng

你已经尝试安装patch_ng模块,但是还是报错。可以尝试使用不同的源进行安装,如清华镜像源
pip install patch_ng -i https://pypi.tuna.tsinghua.edu.cn/simple

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

strggle_bin

一毛不嫌少,十元不嫌多

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值