Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
407 views
in Technique[技术] by (71.8m points)

python - How to install easy OCR

I am trying to install this

https://github.com/JaidedAI/EasyOCR

I have tried installing using pip install easyocr but I keep getting this error

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 https://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:usersfatima.arshadappdatalocalcontinuumanaconda2python.exe' 'c:usersfatima.arshadappdatalocalcontinuumanaconda2libsite-packagespip\_vendorpep517\_in_process.py' get_requires_for_build_wheel 'c:usersfatima~1.arsappdatalocalempmp_bwb7g'
       cwd: c:usersfatima~1.arsappdatalocalemppip-install-hccohnopencv-python
  Complete output (22 lines):
  Traceback (most recent call last):
    File "c:usersfatima.arshadappdatalocalcontinuumanaconda2libsite-packagespip\_vendorpep517\_in_process.py", line 280, in <module>
      main()
    File "c:usersfatima.arshadappdatalocalcontinuumanaconda2libsite-packagespip\_vendorpep517\_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "c:usersfatima.arshadappdatalocalcontinuumanaconda2libsite-packagespip\_vendorpep517\_in_process.py", line 114, in get_requires_for_build_wheel
      return hook(config_settings)
    File "c:usersfatima~1.arsappdatalocalemppip-build-env-xcaozboverlayLibsite-packagessetuptoolsuild_meta.py", line 146, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
    File "c:usersfatima~1.arsappdatalocalemppip-build-env-xcaozboverlayLibsite-packagessetuptoolsuild_meta.py", line 127, in _get_build_requires
      self.run_setup()
    File "c:usersfatima~1.arsappdatalocalemppip-build-env-xcaozboverlayLibsite-packagessetuptoolsuild_meta.py", line 243, in run_setup
      self).run_setup(setup_script=setup_script)
    File "c:usersfatima~1.arsappdatalocalemppip-build-env-xcaozboverlayLibsite-packagessetuptoolsuild_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:usersfatima.arshadappdatalocalcontinuumanaconda2lib
e.py", line 210, in escape
      s = list(pattern)
  TypeError: 'NoneType' object is not iterable
  ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:usersfatima.arshadappdatalocalcontinuumanaconda2python.exe' 'c:usersfatima.arshadappdatalocalcontinuumanaconda2libsite-packagespip\_vendorpep517\_in_process.py' get_requires_for_build_wheel 'c:usersfatima~1.arsappdatalocalempmp_bwb7g' Check 

the logs for full command output.

Not really sure what the error is about. If I install using the second command it simply says that pytorch doesnt satisfy requirement. I installed pytorch but still same issue


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You have an outdated python version in your base environment. This is not necessarily a problem (but you still might want to consider installing an anaconda3/miniconda3 version instead), since you can just create a new environment with a newer python version:

Create new env and activate it:

conda create -n easyocr python=3.8
conda activate easyocr

Install PyTorch (get the correct command depending on your CUDA version from here):

conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch

Then you should be able to run:

pip install easyocr

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share

2.1m questions

2.1m answers

63 comments

56.7k users

...