Home > other >  Would like to ask next everybody, PermissionError: [5] WinError refused access how to solve?
Would like to ask next everybody, PermissionError: [5] WinError refused access how to solve?

Time:09-28

 the from PIL import Image 
The import pytesseract
# pytesseract. Pytesseract. Tesseract_cmd="C: \ \ Program Files \ \ Tesseract (x86) - the OCR \ \ tessdata"
Text=pytesseract. Image_to_string (Image. Open (' en. PNG '), lang='chi_sim')
Print (text)


Error:
 Windows PowerShell 
Copyright (C) Microsoft Corporation, all rights reserved.




PS C: \ Users \ administration \ Desktop \ pythoncode> & C:/Users/administration/AppData/Local/designed/Python/Python37-32/Python. Exe C:/Users/administration/Desktop/pythoncode/test. The py
Traceback (the most recent call last) :
The File "c:/Users/administration/Desktop/pythoncode/test. The py", line 4, the in & lt; module>
Text=pytesseract. Image_to_string (Image. Open (' en. PNG '), lang='chi_sim')
File "C: \ Users \ administration \ AppData \ Local \ designed \ Python \ Python37-32 \ lib \ site - packages \ pytesseract \ pytesseract py", line 347, in image_to_string
} [output_type] ()
File "C: \ Users \ administration \ AppData \ Local \ designed \ Python \ Python37-32 \ lib \ site - packages \ pytesseract \ pytesseract py", line 346, in & lt; lambda>
The Output STRING: lambda: run_and_get_output (* args),
File "C: \ Users \ administration \ AppData \ Local \ designed \ Python \ Python37-32 \ lib \ site - packages \ pytesseract \ pytesseract py", line 257, in run_and_get_output
Run_tesseract (* * kwargs)
File "C: \ Users \ administration \ AppData \ Local \ designed \ Python \ Python37-32 \ lib \ site - packages \ pytesseract \ pytesseract py", line 228, in run_tesseract
Raise e
File "C: \ Users \ administration \ AppData \ Local \ designed \ Python \ Python37-32 \ lib \ site - packages \ pytesseract \ pytesseract py", line 225, in run_tesseract
Proc=subprocess. Popen (cmd_args, * * subprocess_args ())
File "C: \ Users \ administration \ AppData \ Local \ designed \ Python \ Python37-32 \ lib \ subprocess py", line 756, in __init__
Restore_signals start_new_session)
File "C: \ Users \ administration \ AppData \ Local \ designed \ Python \ Python37-32 \ lib \ subprocess py", line 1155, in _execute_child
Startupinfo)
PermissionError: [5] WinError access denied,
PS C: \ Users \ administration \ Desktop \ pythoncode>

I searched online some solving methods, main attention to the problem of python3.7 folder permissions, it was already gave the user full control permissions, or refused to visit?

CodePudding user response:

Hello, you'd better don't want to read the file on disk c, you try to read files in other places
  • Related