简易编程代码:如何安装简易 OCR(easy ocr)

我试图安装这个

s://github/JaidedAI/EasyOCR

我已经尝试使用 pip 安装 easyocr 安装,但我一直收到这个错误

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at s://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting easyocr
  Using cached easyocr-1.0.tar.gz (8.5 MB)
Collecting torch
  Using cached torch-0.1.2.post2.tar.gz (128 kB)
Collecting torchvision
  Using cached torchvision-0.2.2.post3-py2.py3-none-any.whl (64 kB)
Collecting opencv-python
  Using cached opencv-python-4.3.0.38.tar.gz (88.0 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\fatima.arshad\appdata\local\continuum\anaconda2\python.exe' 'c:\users\fatima.arshad\appdata\local\continuum\anaconda2\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'c:\users\fatima~1.ars\appdata\local\temp\tmp_bwb7g'
       cwd: c:\users\fatima~1.ars\appdata\local\temp\pip-install-hccohn\opencv-python
  Complete output (22 lines):
  Traceback (most recent call last):
    File "c:\users\fatima.arshad\appdata\local\continuum\anaconda2\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 280, in <module>
      main()
    File "c:\users\fatima.arshad\appdata\local\continuum\anaconda2\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "c:\users\fatima.arshad\appdata\local\continuum\anaconda2\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 114, in get_requires_for_build_wheel
      return hook(config_settings)
    File "c:\users\fatima~1.ars\appdata\local\temp\pip-build-env-xzb\overlay\Lib\site-packages\setuptools\build_meta.py", line 146, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
    File "c:\users\fatima~1.ars\appdata\local\temp\pip-build-env-xzb\overlay\Lib\site-packages\setuptools\build_meta.py", line 127, in _get_build_requires
      self.run_setup()
    File "c:\users\fatima~1.ars\appdata\local\temp\pip-build-env-xzb\overlay\Lib\site-packages\setuptools\build_meta.py", line 243, in run_setup
      self).run_setup(setup_script=setup_script)
    File "c:\users\fatima~1.ars\appdata\local\temp\pip-build-env-xzb\overlay\Lib\site-packages\setuptools\build_meta.py", line 142, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 448, in <module>
      main()
    File "setup.py", line 99, in main
      % {"ext": re.escape(sysconfig.get_config_var("EXT_SUFFIX"))}
    File "c:\users\fatima.arshad\appdata\local\continuum\anaconda2\lib\re.py", line 210, in escape
      s = list(pattern)
  TypeError: 'NoneType' object is not iterable
  ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\fatima.arshad\appdata\local\continuum\anaconda2\python.exe' 'c:\users\fatima.arshad\appdata\local\continuum\anaconda2\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'c:\users\fatima~1.ars\appdata\local\temp\tmp_bwb7g' Check 

完整命令输出的日志。

不确定错误是什么。如果我使用第二个命令安装,它只是说 pytorch 不满足要求。我安装了 pytorch,但仍然是同样的问题

您的基本环境中有一个过时的 python 版本。这不一定是一个问题(但您仍然可以考虑安装 anaconda3 / miniconda3 版本),因为您可以使用较新的 python 版本创建一个新环境:

创建新的环境并激活它:

conda create -n easyocr python=3.8
conda activate easyocr

安装 PyTorch(根据您的 CUDA 版本从here获取正确的命令):

conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch

然后你应该能够运行:

pip install easyocr

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值