Kill a process in Windows 10 from the PyCharm command line
Updated Answer:
Essentially this problem is caused by temporary files not being deleted, as I found here. The solution for this is to type import tempfile
and tempfile.gettempdir()
into the console to return the path to the temporary file directory. Copy and paste this into the file explorer and navigate into the .tensorboard-info
folder and delete anything inside. This will clear all the processes tensorboard thinks it is running, which should stop the issue from happening.
The reason this issue is happening is that if tensorboard closes unexpectedly it leaves behind temporary files that should have been cleaned up after the process stops. Because of this any new tensorboard process checks the temp folder and finds a file which indicates that another instance is running, even though it no longer is.
Kill external process started by batch file on Windows from within Python script
I managed to solve the issue by running the subprocess.call("taskkill /F /im process.exe")
.
I am not sure why os.system
didn't work in the first place, perhaps it's due to its outdated nature. Hopefully, it helps those who will encounter a similar issue!
Related Topics
How to Install 2 Anacondas (Python 2 and 3) on MAC Os
Reimport a Module While Interactive
Why Are There No ++ and -- Operators in Python
How to Convert a Time.Struct_Time Object into a Datetime Object
How to Login to a Website with Python
Sorting Text File by Using Python
Why Does Str(Float) Return More Digits in Python 3 Than Python 2
How to Escape Special Characters of a String with Single Backslashes
How to Use 'Else' in a List Comprehension
How to Install Pycrypto on Windows
Run Command and Get Its Stdout, Stderr Separately in Near Real Time Like in a Terminal
Keyerror: 'Tcl_Library' When I Use Cx_Freeze
Convert to Binary and Keep Leading Zeros
How to Sort Objects by Multiple Keys
Convert Rgba Png to Rgb with Pil