Search code examples
pythonc#iispyinstallereasyocr

Permission Error C:\WINDOWS\system32\config\systemprofile\.EasyOCR in IIS app which uses Python EXE


I am not sure from where this issue occurs.

I have a python script which uses EasyOCR and has been compiled to an exe. I am using this exe as a process in my asp.NET C# web api to make some OCR validation. When running the exe from command line or running via API from visual studio there is no issue but after I added this API to my local IIS and send a POST request to my API I got the following response from exe.

[WinError 5] Access is denied: 'C:\WINDOWS\system32\config\systemprofile\.EasyOCR'

When I checked the directory there is no folder like this, I tried to create this folder in there but got the same response.

Any help would be appreciated.

Regards


Solution

  • According to this error message, it is usually because the current permissions are insufficient. You can try to execute the program as administrator, or as already mentioned, give permissions to the corresponding application pool. Like this:

    enter image description here

    Or you could try deploy your site on other on other disk (not the system disk).