[Error correction] -Wly error: Permissionerror: [Winerror 32] Another program is using this file, and the process cannot be accessed. "+Solution

tags: Python bug repair  Correction  PermissionError  WinError 32  Process cannot be accessed

content

Sales of the problem

reason

solution


Sales of the problem

Open the PDF file first, get the content of the PDF file, use OS.RMove () to delete the file. At this time

Os.remove (source_path) Permissionerror: [Winerror 32] Another program is using this file, and the process cannot be accessed. : 'D: \\ PartTimejobs \\ ClassifyFilesByCluster \\ Resource \\ Source1 \\ 2011quantitative investigation of a Standard Test Shim for Magnetic.pdf'

reason

Error code

            # ---------------------2022430--------------TODO
            content = []
            for i in pdf.open(path).pages:
                content.append(i.extract_text())

After the above code is opened, the file content is not closed after obtaining the file content

solution

            # ---------------------2022430--------------TODO
            content = []
            f = pdf.open(path)
            for i in f.pages:
                content.append(i.extract_text())
            f.close()

After opening the file to get the content, close the file, and the final error was resolved.

Similar error reference:

 

Intelligent Recommendation

Oldwood Take you --- Install the Python Package Permissionerror: [Winerror 32] Another program is using this file, the process is unacceptable.

When installing the python package with xgboost, the following error may occur: Because the terminal under Window is or the GBK encoding is displayed, the PIP source code is also modified. Open C: \ P...

Kafka in Windows Error: java.nio.file.filesystemXception: Another program is using this file, the process cannot access the process, the process cannot be accessed

Problem Description Kafka deployed in the Windows environment is hung after running for a period of time. View loglogs/server.log Discover the following errors: reason When the consumer's offset log i...

[Error Record] Flutter mixed development error (java.nio.file.filesystemException: xxx / r.jar: Another program is using this file, the process cannot be accessed.)

Article catalog First, error information Second, the solution First, error information FLUTTER Mixed Development Project: In the Android project, embed the flutter page, accidentally run the Flutter p...

python3.7: PermissionError: [WinError 32] The process cannot access the file because it is......

Problem Description: Python3.7, using the library image inside PIL just wants to get the length and wide of the picture Newspaper is wrong D:\Python37-32\python.exe D:/pyFile/python_script/img_read.py...

Python Flask Logging Log Reports An error "Another program is using this file, the process cannot be accessed"

Article catalog Problem 2. Code example 3. Reason 4. Solve Problem Python Flask Logging Log Reports An error "Another program is using this file, the process cannot be accessed" 2. Code exam...

More Recommendation

Java Process: Another program is using this file, the process cannot be accessed

When I recently dealt with strange problems, I made a low -level error, wasted a lot of time, and even watched the C code at the bottom of the JDK. The following test code is run by the Windows enviro...

Android Studio Another program is using this file process that cannot be accessed

I don't know which version begins, AS is always prompts the following errors, A simple solution: Switch toTerminal Window, direct inputgradlew -stop ,AgainbuildIt can be running normally....

Virtual machine startup error: Another program has locked part of the file and cannot be accessed by the process

The virtual machine suddenly reported an error after a certain system as follows: Seeing this interface, although I don’t know the specific reason for the error, I can roughly guess the reason f...

VMware startup error: Another program has locked part of the file and cannot be accessed by the process (delete the most recent .lck folder)

I can't shut down the virtual machine, so I restarted the computer directly, and it turned out like this after restarting. reason: .lck file is a disk lock file of VMWare software. Since the virtual d...

IIS deployment local website prompts that the website cannot be started, another program is using this file, and the process cannot be accessed

Today, the website deployed with IIS cannot be started locally. The default port of https is 443. In order to avoid the port starting with 4 on the local computer, I tried to use port 555, and the pro...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top