jumpcutter icon indicating copy to clipboard operation
jumpcutter copied to clipboard

"Creation of the directory %s failed. The TEMP folder may already exist."

Open NoelHVincent opened this issue 5 years ago • 9 comments

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

NoelHVincent avatar May 16 '19 19:05 NoelHVincent

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

Lamaun avatar May 21 '19 07:05 Lamaun

The temp file might be hidden...

bruhhhhhhhhhh7 avatar Jun 01 '19 07:06 bruhhhhhhhhhh7

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 avatar Jun 16 '19 20:06 Xanbertis

@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?

Lamaun avatar Jun 16 '19 20:06 Lamaun

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.

Lamaun avatar Jun 16 '19 20:06 Lamaun

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.

babbott1000 avatar Sep 24 '19 17:09 babbott1000

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)

Lamaun avatar Sep 24 '19 19:09 Lamaun

I don't know what I did, but I did a bunch of stuff and it started working...

babbott1000 avatar Sep 28 '19 02:09 babbott1000

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.

Sudheer-Nanduri avatar Oct 22 '20 15:10 Sudheer-Nanduri