求助,安装paddle ocr时出错,python神和英文神帮忙

出错提示:
ERROR: Command errored out with exit status 1: 'c:\users\dell\anaconda3\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Dell\\AppData\\Local\\Temp\\pip-install-60sjs4u2\\python-levenshtein_5e6ee9b40e384baf98691d2cf8f88e46\\setup.py'"'"'; __file__='"'"'C:\\Users\\Dell\\AppData\\Local\\Temp\\pip-install-60sjs4u2\\python-levenshtein_5e6ee9b40e384baf98691d2cf8f88e46\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Dell\AppData\Local\Temp\pip-record-4lh4bng7\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\dell\anaconda3\Include\python-Levenshtein' Check the logs for full command output.

这个错误信息里没什么提示都没有。

参考官网的步骤来,装不上就是环境有缺失被污染了,用新的虚拟机装:

https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/install/pip/linux-pip.html

多谢!PaddlePaddle倒是装上了,但装paddleocrhttps://github.com/happog/paddleocr时却频频出错,去网上搜搜解决一个又出现一个。读不懂英文真玩不了电脑了 :rofl:

用linux虚拟机参考上面的步骤,再装ocr,win上问题很多的。这些程序员都是在linux或者mac上写代码,不会去考虑win上出现的问题。

好,再摸索摸索。百度ocr的识别能力在所见过的ocr中确是最强的

安装成功了
Successfully installed imgaug-0.4.0 lmdb-1.2.1 opencv-contrib-python-4.4.0.46 paddleocr-2.3.0.1 premailer-3.10.0 pyclipper-1.3.0
但加载时又出错

 from paddleocr import PaddleOCR, draw_ocr
C:\Users\Dell\Anaconda3\lib\site-packages\socks.py:58: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Callable
C:\Users\Dell\Anaconda3\lib\site-packages\win32\lib\pywintypes.py:2: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp, sys, os
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Dell\Anaconda3\lib\site-packages\paddleocr\__init__.py", line 15, in <module>
    from .paddleocr import *
  File "C:\Users\Dell\Anaconda3\lib\site-packages\paddleocr\paddleocr.py", line 26, in <module>
    from tools.infer import predict_system
  File "C:\Users\Dell\Anaconda3\lib\site-packages\paddleocr\tools\infer\predict_system.py", line 31, in <module>
    import tools.infer.predict_rec as predict_rec
  File "C:\Users\Dell\Anaconda3\lib\site-packages\paddleocr\tools\infer\predict_rec.py", line 31, in <module>
    from ppocr.postprocess import build_post_process
  File "C:\Users\Dell\Anaconda3\lib\site-packages\paddleocr\ppocr\postprocess\__init__.py", line 24, in <module>
    from .db_postprocess import DBPostProcess, DistillationDBPostProcess
  File "C:\Users\Dell\Anaconda3\lib\site-packages\paddleocr\ppocr\postprocess\db_postprocess.py", line 22, in <module>
    from shapely.geometry import Polygon
  File "C:\Users\Dell\Anaconda3\lib\site-packages\shapely\geometry\__init__.py", line 4, in <module>
    from .base import CAP_STYLE, JOIN_STYLE
  File "C:\Users\Dell\Anaconda3\lib\site-packages\shapely\geometry\base.py", line 19, in <module>
    from shapely.coords import CoordinateSequence
  File "C:\Users\Dell\Anaconda3\lib\site-packages\shapely\coords.py", line 8, in <module>
    from shapely.geos import lgeos
  File "C:\Users\Dell\Anaconda3\lib\site-packages\shapely\geos.py", line 154, in <module>
    _lgeos = CDLL(os.path.join(sys.prefix, 'Library', 'bin', 'geos_c.dll'))
  File "C:\Users\Dell\Anaconda3\lib\ctypes\__init__.py", line 356, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] 找不到指定的模块。

对于Windows环境用户:

直接通过pip安装的shapely库可能出现 [winRrror 126] 找不到指定模块的问题 。建议从这里下载shapely安装包完成安装

1 Like

我就是手动装了这个东西,你的方法一定能行
昨晚的问题是刚才装了pip install python_Levenshtein-0.12.2-cp37-cp37m-win_amd64.whl然后成功的。
我刚才在网上搜了一下,说可能缺少微软运行库,正在安装,试试看行不行,不行就用你的方法。
多谢!!!

Shapely is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.
装了运行库也不行,github也上不去了。

1 Like

越搞越晕了

Installing collected packages: pywin32, portalocker, iopath, layoutparser
  Attempting uninstall: pywin32
    Found existing installation: pywin32 223
    Uninstalling pywin32-223:
      Successfully uninstalled pywin32-223
  Rolling back uninstall of pywin32
  Moving to c:\users\dell\anaconda3\lib\site-packages\__pycache__\pythoncom.cpython-37.pyc
   from C:\Users\Dell\AppData\Local\Temp\pip-uninstall-np_i9_4j\pythoncom.cpython-37.pyc
  Moving to c:\users\dell\anaconda3\lib\site-packages\adodbapi
   from c:\users\dell\anaconda3\lib\site-packages\~dodbapi
  Moving to c:\users\dell\anaconda3\lib\site-packages\isapi
   from c:\users\dell\anaconda3\lib\site-packages\~sapi
  Moving to c:\users\dell\anaconda3\lib\site-packages\pythoncom.py
   from C:\Users\Dell\AppData\Local\Temp\pip-uninstall-ryfjvxy2\pythoncom.py
  Moving to c:\users\dell\anaconda3\lib\site-packages\pythonwin
   from c:\users\dell\anaconda3\lib\site-packages\~ythonwin
  Moving to c:\users\dell\anaconda3\lib\site-packages\pywin32-223-py3.7.egg-info
   from c:\users\dell\anaconda3\lib\site-packages\~ywin32-223-py3.7.egg-info
  Moving to c:\users\dell\anaconda3\lib\site-packages\win32\lib\
   from c:\users\dell\anaconda3\lib\site-packages\win32\~ib
  Moving to c:\users\dell\anaconda3\lib\site-packages\win32com
   from c:\users\dell\anaconda3\lib\site-packages\~in32com
  Moving to c:\users\dell\anaconda3\lib\site-packages\win32comext
   from c:\users\dell\anaconda3\lib\site-packages\~in32comext
ERROR: Could not install packages due to an OSError: [WinError 5] 拒绝访问。: 'c:\\users\\dell\\anaconda3\\Lib\\site-packages\\win32\\_win32sysloader.pyd'
Consider using the `--user` option or check the permissions.

不仅如此,pip也出问题了

(base) C:\Users\Dell>pip -v
Error processing line 7 of c:\users\dell\anaconda3\lib\site-packages\pywin32.pth:

  Traceback (most recent call last):
    File "c:\users\dell\anaconda3\lib\site.py", line 168, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  ModuleNotFoundError: No module named 'pywin32_bootstrap'

Remainder of file ignored

好像前面卸载又重装pywin32没有成功,导致运行pip也报错

你paddleorc选的哪个版本?以前装过1.0和2.1,python必须3.7

python 3.7.1
paddleorc2.1

如果是win10系统,可先安装微软的wsl2,然后在wsl2环境下安装和使用paddle

在wsl2处理很多事情都挺方便,如打包解包mdx、epub文件等。需要了解基础的linux系统知识,首先是文件目录系统的基本知识和三五个命令

1 Like

好,我试试看,多谢!

反复考虑,还是装个虚拟机稳定。
很久没用linux,请大神推荐体积小、稳定、带中文的版本。只用于python,最多再学学shell

日常工作用是manjaro,只是简单用用可以装ubuntu,更大众,资料多,应用商店里可以搜索到,最好找个wsl2的教程按步骤来。

那就试试它吧。但http://mirrors.aliyun.com/manjaro/?spm=a2c6h.13651104.0.0.7b24b561T0CClG里不是现成的iso,是要自己打包吗?

官网有iso。

https://manjaro.org/download/

1 Like

上面是桌面版,wsl2+ubuntu的教程,可以参考这个,够用了。

1 Like

用的很舒服。
日常阅读、编辑大多数时间在win10,只是需要打包解包mdx、epub时才在wsl2处理,下载百度盘文件也可以用curl命令的。
很多工具如果在win10使用,需要下载运行各种不明不白的exe,而在wsl2就是几行命令的事。

在等win11的wsl支持图形化界面,那样就能在wsl用Linux版的QQ了

1 Like