fabiogra/moseca

Problem with "File not found"

Closed this issue · 3 comments

FileNotFoundError: [Errno 2] No such file or directory: "\tmp\1.mp3"
Traceback:
File "C:\Users\i\AppData\Local\Programs\Python\Python310\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script
exec(code, module.dict)
File "C:\Users\i\moseca\app\pages\Separate.py", line 290, in
body()
File "C:\Users\i\moseca\app\pages\Separate.py", line 159, in body
with open(in_path / uploaded_file.name, "wb") as f:

image

Could you tell me how to solve this problem?
Thank you for distributing a great program.

Hi @Angsimosaurus, I guess you are running moseca locally using Windows OS and Python doesn't find tmp folder. Have you tried using Windows Subsystem for Linux?

hi @Angsimosaurus , i solved this problem replacing in /app/pages/Separate.py

out_path = Path("/tmp")
in_path = Path("/tmp")

with

def make_path_if_not_exists(path):
    isExist = os.path.exists(path)
    if not isExist:
        os.makedirs(path)

out_path = Path(f"{os.getcwd()}/out_tmp")
in_path = Path(f"{os.getcwd()}/in_tmp")

make_path_if_not_exists(out_path)
make_path_if_not_exists(in_path)

this can be done also in karaoke.py, but youtube is unable to extract initial player response.
Pretty sure is not the best solution (i'm a developer, but not a python developer sorry) but is a temporary patch. Work belowe windows, i don't know with linux.
Moseca is great, hope to see something like a mixer to play all tracks with custom volume and save down the result.

Thanks for the feedback, I'll close this.