1

I've been building out a web crawler and it was working fine, but I wanted to ensure that I was verifying SSL requests so I installed Certifi and since then I've not been able to run my code and it appears to be an issue with the request library.

When I try something such as:

import requests

response = requests.get('https://api.github.com')

it generates an error

[WinError 32] The process cannot access the file because it is being used by another process: 'C:\Users\Temp\tmps97phylw'

I'm using Visual Studio Code and Python 3.10.6 (tags/v3.10.6:9c7b4bd, [MSC v.1932 64 bit (AMD64)] on win32

What I've tried:

  • Having nothing else open on my laptop.
  • Uninstalling both the Certifi and Requests libraries, but I get the same error.
  • restarting my laptop in the hope it will kill off any other processes.
  • Uninstalling VS Code and reinstalling
  • Deleting the virtual environment, but I get the error: "cannot be removed because it is not empty"
  • Have you tried running the program from `cmd` instead of the IDE? I've seen something not work from the IDE – sniperd Nov 22 '22 at 13:39
  • @sniperd I get the same error message. I had a connection issue earlier when I ran my main script so wonder if the connection didn't close. Now I can't find a way to close the connection and everytime I run something with the requests library it generates a new temp file that I can't close. – Michael Cherriman Nov 22 '22 at 14:46

1 Answers1

1

I found another post PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: after installing python-certifi-win32 which suggested deleting removing a file python-certifi-win32-init.pth. This appears to have resolved the issue.

I will also look to replace certifi-win32 as suggested in the above post.