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

**URL:** <https://forum.freemdict.com/t/topic/8800>\
**Category:** 技术交流与词典编修\
**Created:** [2021 年10 月 13 日 13:08 UTC](https://forum.freemdict.com/t/topic/8800 "2021-10-13T13:08:38Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![sxingbai](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sxingbai](https://forum.freemdict.com/u/sxingbai)\
**Post date:** [2021 年10 月 13 日 13:08 UTC](https://forum.freemdict.com/t/topic/8800/1 "2021-10-13T13:08:38Z")

</div>

出错提示：  
`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.`

---

<div class="post-metadata">

**Author:** ![last\_idol](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/last_idol/32/2205_2.png) [@last\_idol](https://forum.freemdict.com/u/last_idol)\
**Post date:** [2021 年10 月 13 日 14:17 UTC](https://forum.freemdict.com/t/topic/8800/2 "2021-10-13T14:17:02Z")

</div>

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

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

> **[开始使用\_飞桨-源于产业实践的开源深度学习平台](https://www.paddlepaddle.org.cn/install/quick?docurl=%2Fdocumentation%2Fdocs%2Fzh%2Finstall%2Fpip%2Flinux-pip.html)**
>
> 飞桨PaddlePaddle快速安装使用方法,安装方式支持：pip,conda,docker,源码编译,选择操作系统快速安装实现您的AI想法.

---

<div class="post-metadata">

**Author:** ![sxingbai](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sxingbai](https://forum.freemdict.com/u/sxingbai)\
**Post date:** [2021 年10 月 13 日 14:30 UTC](https://forum.freemdict.com/t/topic/8800/3 "2021-10-13T14:30:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![last\_idol](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/last_idol/32/2205_2.png) [@last\_idol](https://forum.freemdict.com/u/last_idol)\
**Post date:** [2021 年10 月 13 日 14:30 UTC](https://forum.freemdict.com/t/topic/8800/4 "2021-10-13T14:30:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sxingbai](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sxingbai](https://forum.freemdict.com/u/sxingbai)\
**Post date:** [2021 年10 月 13 日 14:32 UTC](https://forum.freemdict.com/t/topic/8800/5 "2021-10-13T14:32:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sxingbai](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sxingbai](https://forum.freemdict.com/u/sxingbai)\
**Post date:** [2021 年10 月 14 日 04:02 UTC](https://forum.freemdict.com/t/topic/8800/6 "2021-10-14T04:02:42Z")

</div>

安装成功了  
`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`  
但加载时又出错

```auto
 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] 找不到指定的模块。

```

---

<div class="post-metadata">

**Author:** ![last\_idol](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/last_idol/32/2205_2.png) [@last\_idol](https://forum.freemdict.com/u/last_idol)\
**Post date:** [2021 年10 月 14 日 04:16 UTC](https://forum.freemdict.com/t/topic/8800/7 "2021-10-14T04:16:16Z")

</div>

对于Windows环境用户：

直接通过pip安装的shapely库可能出现 `[winRrror 126] 找不到指定模块的问题` 。建议从[这里](https://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely)下载shapely安装包完成安装

> <https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.3/doc/doc_ch/quickstart.md>

---

<div class="post-metadata">

**Author:** ![sxingbai](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sxingbai](https://forum.freemdict.com/u/sxingbai)\
**Post date:** [2021 年10 月 14 日 04:20 UTC](https://forum.freemdict.com/t/topic/8800/8 "2021-10-14T04:20:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sxingbai](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sxingbai](https://forum.freemdict.com/u/sxingbai)\
**Post date:** [2021 年10 月 14 日 05:02 UTC](https://forum.freemdict.com/t/topic/8800/9 "2021-10-14T05:02:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sxingbai](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sxingbai](https://forum.freemdict.com/u/sxingbai)\
**Post date:** [2021 年10 月 14 日 07:32 UTC](https://forum.freemdict.com/t/topic/8800/10 "2021-10-14T07:32:39Z")

</div>

越搞越晕了

```auto
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也出问题了

```auto
(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也报错

---

<div class="post-metadata">

**Author:** ![Johnny\_Van](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/johnny_van/32/9431_2.png) [@Johnny\_Van](https://forum.freemdict.com/u/Johnny_Van)\
**Post date:** [2021 年10 月 14 日 09:59 UTC](https://forum.freemdict.com/t/topic/8800/11 "2021-10-14T09:59:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sxingbai](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sxingbai](https://forum.freemdict.com/u/sxingbai)\
**Post date:** [2021 年10 月 14 日 10:02 UTC](https://forum.freemdict.com/t/topic/8800/12 "2021-10-14T10:02:08Z")

</div>

> [@sxingbai](#):
>
> `Remainder`

python 3.7.1  
paddleorc2.1

---

<div class="post-metadata">

**Author:** ![endnote](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/e/9de0a6/32.png) [@endnote](https://forum.freemdict.com/u/endnote)\
**Post date:** [2021 年10 月 14 日 10:02 UTC](https://forum.freemdict.com/t/topic/8800/13 "2021-10-14T10:02:51Z")

</div>

> [@last\_idol](#):
>
> 程序员都是在linux或者mac上写代码，不会去考虑win上出现的问题

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

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

---

<div class="post-metadata">

**Author:** ![sxingbai](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sxingbai](https://forum.freemdict.com/u/sxingbai)\
**Post date:** [2021 年10 月 14 日 10:06 UTC](https://forum.freemdict.com/t/topic/8800/14 "2021-10-14T10:06:24Z")

</div>

好，我试试看，多谢！

---

<div class="post-metadata">

**Author:** ![sxingbai](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sxingbai](https://forum.freemdict.com/u/sxingbai)\
**Post date:** [2021 年10 月 14 日 10:30 UTC](https://forum.freemdict.com/t/topic/8800/15 "2021-10-14T10:30:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![last\_idol](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/last_idol/32/2205_2.png) [@last\_idol](https://forum.freemdict.com/u/last_idol)\
**Post date:** [2021 年10 月 14 日 10:45 UTC](https://forum.freemdict.com/t/topic/8800/16 "2021-10-14T10:45:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sxingbai](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sxingbai](https://forum.freemdict.com/u/sxingbai)\
**Post date:** [2021 年10 月 14 日 10:58 UTC](https://forum.freemdict.com/t/topic/8800/17 "2021-10-14T10:58:09Z")

</div>

> [@last\_idol](#):
>
> manjaro

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

---

<div class="post-metadata">

**Author:** ![last\_idol](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/last_idol/32/2205_2.png) [@last\_idol](https://forum.freemdict.com/u/last_idol)\
**Post date:** [2021 年10 月 14 日 11:28 UTC](https://forum.freemdict.com/t/topic/8800/18 "2021-10-14T11:28:51Z")

</div>

官网有iso。

> **[Manjaro Downloads](https://manjaro.org/download/)**
>
> Find a suitable Manjaro edition for your hardware.

---

<div class="post-metadata">

**Author:** ![last\_idol](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/last_idol/32/2205_2.png) [@last\_idol](https://forum.freemdict.com/u/last_idol)\
**Post date:** [2021 年10 月 14 日 11:29 UTC](https://forum.freemdict.com/t/topic/8800/19 "2021-10-14T11:29:57Z")

</div>

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

> **[在Windows 10上安装WSL2](https://segmentfault.com/a/1190000040143442)**
>
> WSL2（Windows Subsystem for Linux ）是Windows 10上的一个工具，允许开发人员在Windows上直接运行Linux环境，使得在Windows系统上进行Linux的原生体验。

---

<div class="post-metadata">

**Author:** ![endnote](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/e/9de0a6/32.png) [@endnote](https://forum.freemdict.com/u/endnote)\
**Post date:** [2021 年10 月 14 日 12:55 UTC](https://forum.freemdict.com/t/topic/8800/20 "2021-10-14T12:55:23Z")

</div>

> [@last\_idol](#):
>
> wsl2+ubuntu

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

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

[下一页](https://forum.freemdict.com/t/topic/8800.md?page=2)
