[Winerror 32] Another program is using this file, the process cannot be accessed, # image processing

tags: python  django  

When making image processing, I used three modules OS, PIL, CV2. I encountered a bug who plagued one morning, I investigated several resource monitor ~~~, bug as follows:

Description of Requirement:

1. First of all, I need to handle the target image into the format I need with PIL.
2. Get the newly generated image of the newly generated image to be used for subsequent use
3. The new image is not saved in the library, directly delete

new_url = "D:···537fd8cb01c4004d62c473661672abbc1623211844.8764274.jpeg"
old_url = "D:····537fd8cb01c4004d62c473661672abbc.jpeg"
img = cv2.VideoCapture(new_url)
width = int(img.get(cv2.CAP_PROP_FRAME_WIDTH))
img.release()
cv2.destroyAllWindows()
with open(resize_img, 'rb') as f:
    ……
# Related business logic omitted ...
if new_url != old_url:
	if os.path.exists(new_url):
		os.remove(new_url)

problem solved:

After the investigation, the BUG appears because the CV2 module displays the image object, I didn't turn it off, and the next side I deleted the unsturned image, the last process did not end, and the error was executed

# Close resolution
img.release()
cv2.destroyAllWindows()  # Destroy the designated window

The pit of yourself is completed ...

How many milliseconds are currently in the video: Temp1 = Cap.get (cv2.cap_prop_pos_msec)
High video: temp2 = cap.get (cv2.cap_prop_frame_height)
Video width: temp3 = cap.get (cv2.cap_prop_frame_width)
Video frame rate: temp4 = cap.get (cv2.cap_prop_fps)
Video encoding method: TEMP5 = cap.get (cv2.cap_prop_fourcc)
Video total frame number: TEMP6 = Cap.get (cv2.cap_prop_frame_count)

Intelligent Recommendation

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....

Deefinf bug: Permissionerror: [Winerror 32] Another program is using this file, the process is unable to access

It is because the other machine is running with the same user name, so can't run?...

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...

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...

More Recommendation

Kafka 0.11x automatically stops after 30 seconds of startup, reported [another program is using this file, the process cannot be accessed]...

Environment: kafka_2.11-1.1.0, win7_64, java8 Phenomenon: automatically stops after 30 seconds of startup, reported [another program is using this file, the process cannot be accessed] It can be seen ...

Tips when compiling idea: another program is using this file, the process cannot be accessed; the problem is fixed

Regarding the idea when compiling idea: Another program is using this file and the process cannot be accessed. Problem repair record First report the original text: Error:Maven Resources Compiler: Fai...

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...

[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...

2021-05-05 Using Exifread to find a picture to shoot the date, rename the file, another program is using this file, and the process cannot be accessed.

Use Exifread to find a picture date, rename the file, and another program is using this file, the process is unacceptable. Error prompt appears: Traceback (most recent call last):   File "C:...

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

Top