jumpcutter
jumpcutter copied to clipboard
"Creation of the directory %s failed. The TEMP folder may already exist."
I get this error before the script even begins processing the video. I've done everything suggested in the other threads, such as placing the video in the same directory as the py script, installing ffmpeg, etc. I checked to see whether a TEMP folder has been created. It hadn't.
Maybe it's a permissions issue with os.mkdir()? Any help would be really appreciated.
Here's the console output:
C:\WINDOWS\system32>python D:\DDocuments\jumpcutter-master\jumpcutter.py --input_file whatssohard.mp4 --output_file test1.mp4
Traceback (most recent call last):
File "D:\DDocuments\jumpcutter-master\jumpcutter.py", line 44, in createPath
os.mkdir(s)
FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'TEMP'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\DDocuments\jumpcutter-master\jumpcutter.py", line 93, in <module>
createPath(TEMP_FOLDER)
File "D:\DDocuments\jumpcutter-master\jumpcutter.py", line 46, in createPath
assert False, "Creation of the directory %s failed. (The TEMP folder may already exist. Delete or rename it, and try again.)"
AssertionError: Creation of the directory %s failed. (The TEMP folder may already exist. Delete or rename it, and try again.)
C:\WINDOWS\system32>python D:\DDocuments\jumpcutter-master\jumpcutter.py --input_file whatssohard.mp4 --output_file test1.mp4
Well it seems like you are executing the Python Process from C:\WINDOWS\system32 The script will try to create the TEMP folder in your current folder. I'm guessing no process without admin rights should be able to write in system32.
Before executing the jumpcutter.py script try cd D:\DDocuments\jumpcutter-master\jumpcutter.py that way your python process will have the jumpcutter-master folder as working directory
The temp file might be hidden...
Same problem here, no TEMP folder to be seen (even a hidden one) plus tried running the program as admin and from somwhere else than system32 but the problem persists... Any help would be greatly appreciated
@Xanbertis Where did you try it? Which OS are you on? What version of pip and python are you using? What did you do to reach your current state?
You can also try to use a fork, which already implemented the tempfolder creation with the more pythonic way of import tempfile. Under Linux this will always try to create the tempdir under /tmp and automatically tries some different folders if this fails. Im expecting an equivalent behavior on windows.
This should basically allow jumpcutter.py to be run from anywhere.
Tried running on WSL Ubuntu 18.04.02 LTS, I get this same error, no idea if it's because I'm using WSL or not, because it seems other people are having similar issues running on actual Linux.
I just realized, that the method createPath was probably intended like this: (probably a merge oversight)
def createPath(s):
#assert (not os.path.exists(s)), "The filepath "+s+" already exists. Don't want to overwrite it. Aborting."
try:
os.mkdir(s)
except OSError:
assert False, "Creation of the directory " + s +" failed. (The TEMP folder may already exist. Delete or rename it, and try again.)"
That would produce more helpful exceptions. You can try replacing the method and posting the new Exception.
Other than that I'm curios if this also happens with my fork (can you please try https://github.com/Lamaun/jumpcutter)
I don't know what I did, but I did a bunch of stuff and it started working...
The change by @Lamaun displays the location, when the error comes up. For the problem faced by @NoelHVincent, I changed line 90, TEMP_FOLDER = "TEMP" to TEMP_FOLDER = "C:/Users/../{some random folder name}" and it worked well.