Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileNotFoundError: [WinError 2] #95

Open
lererledd opened this issue Jan 2, 2024 · 9 comments
Open

FileNotFoundError: [WinError 2] #95

lererledd opened this issue Jan 2, 2024 · 9 comments

Comments

@lererledd
Copy link

Captura de pantalla 2024-01-02 040616
hello!!! I am Spanish and very beginner haha, I do not speak much English but I want to solve this problem, every time I upload something, and I hit "transcribe"; I get this: "FileNotFoundError: [WinError 2] The system can not find the specified file" although I upload it in upload or local path, how could I solve it, thanks in advance and sorry to bother

@abdeladim-s
Copy link
Owner

abdeladim-s commented Jan 2, 2024

Hello @lererledd,
No problem, your english is very good 😅

Regarding the error, if you are running the project locally just use local path (from file mode) and provide the absolute path of your media file (not a relative path).
If the absolute path does not work, please copy/paste the entire error so I can see clearly from where the problem is coming.

@lererledd
Copy link
Author

lererledd commented Jan 2, 2024

imagen

I always get this error, in any of the models

entire error:

FileNotFoundError: [WinError 2] El sistema no puede encontrar el archivo especificado
Traceback:

File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script
exec(code, module.dict)
File "C:\Program Files\Python310\Lib\site-packages\subsai\webui.py", line 545, in
run()
File "C:\Program Files\Python310\Lib\site-packages\subsai\webui.py", line 538, in run
webui()
File "C:\Program Files\Python310\Lib\site-packages\subsai\webui.py", line 318, in webui
subs = _transcribe(file_path, stt_model_name, model_config)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 194, in wrapper
return cached_func(*args, **kwargs)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 223, in call
return self._get_or_create_cached_value(args, kwargs)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 248, in _get_or_create_cached_value
return self._handle_cache_miss(cache, value_key, func_args, func_kwargs)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 302, in _handle_cache_miss
computed_value = self._info.func(*func_args, **func_kwargs)
File "C:\Program Files\Python310\Lib\site-packages\subsai\webui.py", line 190, in _transcribe
subs = subs_ai.transcribe(media_file=file_path, model=model)
File "C:\Program Files\Python310\lib\site-packages\subsai\main.py", line 115, in transcribe
return stt_model.transcribe(media_file)
File "C:\Program Files\Python310\lib\site-packages\subsai\models\whisperX_model.py", line 130, in transcribe
audio = whisperx.load_audio(media_file)
File "C:\Users\juang\AppData\Roaming\Python\Python310\site-packages\whisperx\audio.py", line 46, in load_audio
ffmpeg.input(file, threads=0)
File "C:\Users\juang\AppData\Roaming\Python\Python310\site-packages\ffmpeg_run.py", line 313, in run
process = run_async(
File "C:\Users\juang\AppData\Roaming\Python\Python310\site-packages\ffmpeg_run.py", line 284, in run_async
return subprocess.Popen(
File "C:\Program Files\Python310\lib\subprocess.py", line 971, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Program Files\Python310\lib\subprocess.py", line 1440, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,

@abdeladim-s
Copy link
Owner

@lererledd, You didn't copy the entire error. There should be something after this hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
You can take a look at the terminal window and copy it from there.

@lererledd
Copy link
Author

lererledd commented Jan 2, 2024

@abdeladim-s

imagen

Exception ignored in: <finalize object at 0x2436aaad960; dead>
Traceback (most recent call last):
File "C:\Program Files\Python310\lib\weakref.py", line 591, in call
return info.func(*info.args, **(info.kwargs or {}))
File "C:\Program Files\Python310\lib\tempfile.py", line 859, in _cleanup
cls._rmtree(name, ignore_errors=ignore_errors)
File "C:\Program Files\Python310\lib\tempfile.py", line 855, in _rmtree
_shutil.rmtree(name, onerror=onerror)
File "C:\Program Files\Python310\lib\shutil.py", line 750, in rmtree
return _rmtree_unsafe(path, onerror)
File "C:\Program Files\Python310\lib\shutil.py", line 620, in _rmtree_unsafe
onerror(os.unlink, fullname, sys.exc_info())
File "C:\Program Files\Python310\lib\tempfile.py", line 846, in onerror
cls._rmtree(path, ignore_errors=ignore_errors)
File "C:\Program Files\Python310\lib\tempfile.py", line 855, in _rmtree
_shutil.rmtree(name, onerror=onerror)
File "C:\Program Files\Python310\lib\shutil.py", line 750, in rmtree
return _rmtree_unsafe(path, onerror)
File "C:\Program Files\Python310\lib\shutil.py", line 601, in _rmtree_unsafe
onerror(os.scandir, path, sys.exc_info())
File "C:\Program Files\Python310\lib\shutil.py", line 598, in _rmtree_unsafe
with os.scandir(path) as scandir_it:
NotADirectoryError: [WinError 267] El nombre del directorio no es válido: 'C:\Users\juang\AppData\Local\Temp\tmpaoa1da84\S.mp4'
Warning: temperature does not have a supported UI
Exception ignored in: <finalize object at 0x2436ae5c340; dead>
Traceback (most recent call last):
File "C:\Program Files\Python310\lib\weakref.py", line 591, in call
return info.func(*info.args, **(info.kwargs or {}))
File "C:\Program Files\Python310\lib\tempfile.py", line 859, in _cleanup
cls._rmtree(name, ignore_errors=ignore_errors)
File "C:\Program Files\Python310\lib\tempfile.py", line 855, in _rmtree
_shutil.rmtree(name, onerror=onerror)
File "C:\Program Files\Python310\lib\shutil.py", line 750, in rmtree
return _rmtree_unsafe(path, onerror)
File "C:\Program Files\Python310\lib\shutil.py", line 620, in _rmtree_unsafe
onerror(os.unlink, fullname, sys.exc_info())
File "C:\Program Files\Python310\lib\tempfile.py", line 846, in onerror
cls._rmtree(path, ignore_errors=ignore_errors)
File "C:\Program Files\Python310\lib\tempfile.py", line 855, in _rmtree
_shutil.rmtree(name, onerror=onerror)
File "C:\Program Files\Python310\lib\shutil.py", line 750, in rmtree
return _rmtree_unsafe(path, onerror)
File "C:\Program Files\Python310\lib\shutil.py", line 601, in _rmtree_unsafe
onerror(os.scandir, path, sys.exc_info())
File "C:\Program Files\Python310\lib\shutil.py", line 598, in _rmtree_unsafe
with os.scandir(path) as scandir_it:
NotADirectoryError: [WinError 267] El nombre del directorio no es válido: 'C:\Users\juang\AppData\Local\Temp\tmphokwhdm6\S.mp4'
Warning: temperature does not have a supported UI
Exception ignored in: <finalize object at 0x2436ae45800; dead>
Traceback (most recent call last):
File "C:\Program Files\Python310\lib\weakref.py", line 591, in call
return info.func(*info.args, **(info.kwargs or {}))
File "C:\Program Files\Python310\lib\tempfile.py", line 859, in _cleanup
cls._rmtree(name, ignore_errors=ignore_errors)
File "C:\Program Files\Python310\lib\tempfile.py", line 855, in _rmtree
_shutil.rmtree(name, onerror=onerror)
File "C:\Program Files\Python310\lib\shutil.py", line 750, in rmtree
return _rmtree_unsafe(path, onerror)
File "C:\Program Files\Python310\lib\shutil.py", line 620, in _rmtree_unsafe
onerror(os.unlink, fullname, sys.exc_info())
File "C:\Program Files\Python310\lib\tempfile.py", line 846, in onerror
cls._rmtree(path, ignore_errors=ignore_errors)
File "C:\Program Files\Python310\lib\tempfile.py", line 855, in _rmtree
_shutil.rmtree(name, onerror=onerror)
File "C:\Program Files\Python310\lib\shutil.py", line 750, in rmtree
return _rmtree_unsafe(path, onerror)
File "C:\Program Files\Python310\lib\shutil.py", line 601, in _rmtree_unsafe
onerror(os.scandir, path, sys.exc_info())
File "C:\Program Files\Python310\lib\shutil.py", line 598, in _rmtree_unsafe
with os.scandir(path) as scandir_it:
NotADirectoryError: [WinError 267] El nombre del directorio no es válido: 'C:\Users\juang\AppData\Local\Temp\tmp43evlsvd\S.mp4'
Warning: temperature does not have a supported UI
2024-01-03 00:00:14.026 Uncaught app exception
Traceback (most recent call last):
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\storage\in_memory_cache_storage_wrapper.py", line 87, in get
entry_bytes = self._read_from_mem_cache(key)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\storage\in_memory_cache_storage_wrapper.py", line 137, in _read_from_mem_cache
raise CacheStorageKeyNotFoundError("Key not found in mem cache")
streamlit.runtime.caching.storage.cache_storage_protocol.CacheStorageKeyNotFoundError: Key not found in mem cache

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\cache_data_api.py", line 588, in read_result
pickled_entry = self.storage.get(key)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\storage\in_memory_cache_storage_wrapper.py", line 89, in get
entry_bytes = self._persist_storage.get(key)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\storage\local_disk_cache_storage.py", line 133, in get
raise CacheStorageKeyNotFoundError(
streamlit.runtime.caching.storage.cache_storage_protocol.CacheStorageKeyNotFoundError: Local disk cache storage is disabled (persist=None)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 245, in _get_or_create_cached_value
cached_result = cache.read_result(value_key)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\cache_data_api.py", line 590, in read_result
raise CacheKeyNotFoundError(str(e)) from e
streamlit.runtime.caching.cache_errors.CacheKeyNotFoundError: Local disk cache storage is disabled (persist=None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\storage\in_memory_cache_storage_wrapper.py", line 87, in get
entry_bytes = self._read_from_mem_cache(key)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\storage\in_memory_cache_storage_wrapper.py", line 137, in _read_from_mem_cache
raise CacheStorageKeyNotFoundError("Key not found in mem cache")
streamlit.runtime.caching.storage.cache_storage_protocol.CacheStorageKeyNotFoundError: Key not found in mem cache

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\cache_data_api.py", line 588, in read_result
pickled_entry = self.storage.get(key)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\storage\in_memory_cache_storage_wrapper.py", line 89, in get
entry_bytes = self._persist_storage.get(key)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\storage\local_disk_cache_storage.py", line 133, in get
raise CacheStorageKeyNotFoundError(
streamlit.runtime.caching.storage.cache_storage_protocol.CacheStorageKeyNotFoundError: Local disk cache storage is disabled (persist=None)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 293, in _handle_cache_miss
cached_result = cache.read_result(value_key)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\cache_data_api.py", line 590, in read_result
raise CacheKeyNotFoundError(str(e)) from e
streamlit.runtime.caching.cache_errors.CacheKeyNotFoundError: Local disk cache storage is disabled (persist=None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script
exec(code, module.dict)
File "C:\Program Files\Python310\Lib\site-packages\subsai\webui.py", line 545, in
run()
File "C:\Program Files\Python310\Lib\site-packages\subsai\webui.py", line 538, in run
webui()
File "C:\Program Files\Python310\Lib\site-packages\subsai\webui.py", line 318, in webui
subs = _transcribe(file_path, stt_model_name, model_config)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 194, in wrapper
return cached_func(*args, **kwargs)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 223, in call
return self._get_or_create_cached_value(args, kwargs)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 248, in _get_or_create_cached_value
return self._handle_cache_miss(cache, value_key, func_args, func_kwargs)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 302, in _handle_cache_miss
computed_value = self._info.func(*func_args, **func_kwargs)
File "C:\Program Files\Python310\Lib\site-packages\subsai\webui.py", line 190, in _transcribe
subs = subs_ai.transcribe(media_file=file_path, model=model)
File "C:\Program Files\Python310\lib\site-packages\subsai\main.py", line 115, in transcribe
return stt_model.transcribe(media_file)
File "C:\Program Files\Python310\lib\site-packages\subsai\models\whisper_model.py", line 207, in transcribe
audio = whisper.load_audio(media_file)
File "C:\Program Files\Python310\lib\site-packages\whisper\audio.py", line 58, in load_audio
out = run(cmd, capture_output=True, check=True).stdout
File "C:\Program Files\Python310\lib\subprocess.py", line 503, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Program Files\Python310\lib\subprocess.py", line 971, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Program Files\Python310\lib\subprocess.py", line 1440, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] El sistema no puede encontrar el archivo especificado

@abdeladim-s
Copy link
Owner

There are so many exceptions.
Seems like you are using the upload mode:
NotADirectoryError: [WinError 267] El nombre del directorio no es válido: 'C:\Users\juang\AppData\Local\Temp\tmp43evlsvd\S.mp4'

What problem do you get when you use local path mode ?

@lererledd
Copy link
Author

@abdeladim-s

local path mode:

2024-01-03 01:24:42.143
Uncaught app exception
Traceback (most recent call last):
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\storage\in_memory_cache_storage_wrapper.py", line 87, in get
entry_bytes = self._read_from_mem_cache(key)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\storage\in_memory_cache_storage_wrapper.py", line 137, in _read_from_mem_cache
raise CacheStorageKeyNotFoundError("Key not found in mem cache")
streamlit.runtime.caching.storage.cache_storage_protocol.CacheStorageKeyNotFoundError: Key not found in mem cache

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\cache_data_api.py", line 588, in read_result
pickled_entry = self.storage.get(key)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\storage\in_memory_cache_storage_wrapper.py", line 89, in get
entry_bytes = self._persist_storage.get(key)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\storage\local_disk_cache_storage.py", line 133, in get
raise CacheStorageKeyNotFoundError(
streamlit.runtime.caching.storage.cache_storage_protocol.CacheStorageKeyNotFoundError: Local disk cache storage is disabled (persist=None)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 245, in _get_or_create_cached_value
cached_result = cache.read_result(value_key)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\cache_data_api.py", line 590, in read_result
raise CacheKeyNotFoundError(str(e)) from e
streamlit.runtime.caching.cache_errors.CacheKeyNotFoundError: Local disk cache storage is disabled (persist=None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\storage\in_memory_cache_storage_wrapper.py", line 87, in get
entry_bytes = self._read_from_mem_cache(key)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\storage\in_memory_cache_storage_wrapper.py", line 137, in _read_from_mem_cache
raise CacheStorageKeyNotFoundError("Key not found in mem cache")
streamlit.runtime.caching.storage.cache_storage_protocol.CacheStorageKeyNotFoundError: Key not found in mem cache

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\cache_data_api.py", line 588, in read_result
pickled_entry = self.storage.get(key)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\storage\in_memory_cache_storage_wrapper.py", line 89, in get
entry_bytes = self._persist_storage.get(key)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\storage\local_disk_cache_storage.py", line 133, in get
raise CacheStorageKeyNotFoundError(
streamlit.runtime.caching.storage.cache_storage_protocol.CacheStorageKeyNotFoundError: Local disk cache storage is disabled (persist=None)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 293, in _handle_cache_miss
cached_result = cache.read_result(value_key)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\cache_data_api.py", line 590, in read_result
raise CacheKeyNotFoundError(str(e)) from e
streamlit.runtime.caching.cache_errors.CacheKeyNotFoundError: Local disk cache storage is disabled (persist=None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script
exec(code, module.dict)
File "C:\Program Files\Python310\Lib\site-packages\subsai\webui.py", line 545, in
run()
File "C:\Program Files\Python310\Lib\site-packages\subsai\webui.py", line 538, in run
webui()
File "C:\Program Files\Python310\Lib\site-packages\subsai\webui.py", line 318, in webui
subs = _transcribe(file_path, stt_model_name, model_config)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 194, in wrapper
return cached_func(*args, **kwargs)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 223, in call
return self._get_or_create_cached_value(args, kwargs)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 248, in _get_or_create_cached_value
return self._handle_cache_miss(cache, value_key, func_args, func_kwargs)
File "C:\Program Files\Python310\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 302, in _handle_cache_miss
computed_value = self._info.func(*func_args, **func_kwargs)
File "C:\Program Files\Python310\Lib\site-packages\subsai\webui.py", line 190, in _transcribe
subs = subs_ai.transcribe(media_file=file_path, model=model)
File "C:\Program Files\Python310\lib\site-packages\subsai\main.py", line 115, in transcribe
return stt_model.transcribe(media_file)
File "C:\Program Files\Python310\lib\site-packages\subsai\models\whisper_model.py", line 207, in transcribe
audio = whisper.load_audio(media_file)
File "C:\Program Files\Python310\lib\site-packages\whisper\audio.py", line 58, in load_audio
out = run(cmd, capture_output=True, check=True).stdout
File "C:\Program Files\Python310\lib\subprocess.py", line 503, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Program Files\Python310\lib\subprocess.py", line 971, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Program Files\Python310\lib\subprocess.py", line 1440, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] El sistema no puede encontrar el archivo especificado

@abdeladim-s
Copy link
Owner

Seems like there is something wrong with your installation and streamlit cannot store the cache.
Could you please try an earlier version of streamlit, in your terminal run:
pip install streamlit==1.19.0 for example ?

@lererledd
Copy link
Author

lererledd commented Jan 3, 2024

Seems like there is something wrong with your installation and streamlit cannot store the cache. Could you please try an earlier version of streamlit, in your terminal run: pip install streamlit==1.19.0 for example ?

@abdeladim-s I just tried it and I still get the same error, how can I fix it?

@abdeladim-s
Copy link
Owner

In that case I would suggest to use Docker. It will take some time and space to build the image but at least it will work out of the box. You can follow the instructions on the Readme page.
Let me know if you found any difficulties ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants