question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PermissionError: [WinError 32] The process cannot access the file because it is being used by another process

See original GitHub issue

Describe the bug I get the error PermissionError: [WinError 32] The process cannot access the file because it is being used by another process

To Reproduce Steps to reproduce the behavior:

  1. pip install pdf2image
  2. Run the following code
with tempfile.TemporaryDirectory() as path:
    images_from_path = convert_from_path(data_path, output_folder=path)
  1. See error
Traceback (most recent call last):
  File "...\lib\tempfile.py", line 803, in onerror
    _os.unlink(path)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: '...\\AppData\\Local\\Temp\\tmppglie128\\ad47d7e6-b50f-4bb9-ad12-533e4e25b4a9-001.ppm'

Desktop (please complete the following information):

  • OS: Windows
  • Version 1.13.1

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
Belvalcommented, Oct 15, 2020

When you exit the context, the underlying image files are open in your Python process. This causes an issue because the temporary directory deletion cannot take place on Windows as it contains open files.

If you don’t use a temporary directory you won’t have this issue.

0reactions
dheeraj009joshicommented, Mar 19, 2022

@Belval i am not using temporary directory but still getting this issue

here is my code :– image

i am just creating the folder and downloading medias to it then reuploading it then want to delete that folder but it is showing this err

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

[WinError 32] The process cannot access the file because it is ...
PermissionError : [WinError 32] The process cannot access the file because it is being used by another process · Subscribe to RSS.
Read more >
[WinError 32] The process cannot access the file because it is ...
Help with PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'newids.txt'.
Read more >
os.remove permissionerror winerror 32 - You.com | The AI ...
PermissionError : [WinError 32] The process cannot access the file because it is being used by another process python python-3.x file-handling 110,020 Solution...
Read more >
[WinError 32] The process cannot access the file because it is ...
PermissionError : [WinError 32] The process cannot access the file because it is being used by another process · i run debugger with...
Read more >
PermissionError: [WinError 32] The process cannot access
PermissionError : [WinError 32] The process cannot access the file because it is being used by another process ... Hi there,. I proudly...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found