0

When I run this code

import easyocr
import cv2

reader = easyocr.Reader(['en'])
result = reader.readtext(r"C:\Users\sephi\Downloads\ocr.jpg")

I got this error.How to solve this issue?

[ERROR]  raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
  • What are the permission on the file you are trying to access? – Mansoor Dec 24 '20 at 15:14
  • alwys put full error message (starting at word "Traceback") in question (not comment) as text (not screenshot). Ther are other useful information. – furas Dec 24 '20 at 15:27

1 Answers1

1

This error can be resolved but its a long process

first uninstall easyocr, torch and torchvision using terminal

pip uninstall easyocr
pip uninstall torch`
pip uninstall torchvision

after above step run

pip install torch==1.7.1+cpu torchvision==0.8.2+cpu torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html

now if Git is install in your system simply install easyocr directly by original link by command:

pip install git+git://github.com/jaidedai/easyocr.git

if git is not installed then install it from here : install git for windows : https://git-scm.com/download/win

after installation follow these steps :

  1. Search for Advanced system settings

  2. click on "Environment Variables"

  3. Now under System Variables find "PATH" And click on it

  4. minimize above screen and go to c drive and search and copy path of git.exe and cmd from git folder in my case it was :- C:\Program Files\Git\cmd; C:\Program Files\Git\bin\git.exe

  5. Paste both address in "PATH" and click ok

You can also refer to :- How to change environment variables : Git: Installing Git in PATH with GitHub client for Windows

Finally when torchvision, torch, easyocr are latest in your system and git is installed it should resolve your error