allan n00b
Joined: 24 Feb 2003 Posts: 48 Location: Ann Arbor,Michigan
|
Posted: Sat Oct 12, 2024 11:56 pm Post subject: Python module not found despite being installed. |
|
|
I'm trying to install vosk_autosrt ( https://github.com/botbahlul/vosk_autosrt ) to generate subtitles for some videos.
I setup a virtual environment to install it into:
Code: | python -m venv ./vosk_autosrt |
Then I activated the environment and run the install command:
Code: | cd vosk_autosrt
source bin/activate
pip install vosk_autosrt
|
But the install fails with this error:
Code: | Collecting vosk_autosrt
Using cached vosk_autosrt-0.1.7.tar.gz (21.5 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [26 lines of output]
/tmp/pip-install-f0jvlqqb/vosk-autosrt_c447e9e93ea64378aefad19f6e233e78/vosk_autosrt/__init__.py:2036: SyntaxWarning: invalid escape sequence '\:'
scale_switch = "'trunc(iw/2)*2'\:'trunc(ih/2)*2'"
/tmp/pip-install-f0jvlqqb/vosk-autosrt_c447e9e93ea64378aefad19f6e233e78/vosk_autosrt/__init__.py:2686: SyntaxWarning: invalid escape sequence '\:'
scale_switch = "'trunc(iw/2)*2'\:'trunc(ih/2)*2'"
Traceback (most recent call last):
File "/home/xxxxx/vosk_autosrt/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/home/xxxxx/vosk_autosrt/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xxxxx/vosk_autosrt/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-moiix8ly/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 332, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-moiix8ly/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 302, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-moiix8ly/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 503, in run_setup
super().run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-moiix8ly/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 318, in run_setup
exec(code, locals())
File "<string>", line 18, in <module>
File "/tmp/pip-install-f0jvlqqb/vosk-autosrt_c447e9e93ea64378aefad19f6e233e78/vosk_autosrt/__init__.py", line 12, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
|
After extensive googling, I verified that I only have one version of python installed (version 3.12), and that the output of pip list shows that the module is installed in the virtual environment.
Code: | Package Version
------------------ ---------
certifi 2024.8.30
cffi 1.17.1
chardet 5.2.0
charset-normalizer 3.3.2
idna 3.10
pip 24.2
progressbar2 4.5.0
pycparser 2.22
pysrt 1.1.2
python-utils 3.9.0
requests 2.32.3
six 1.16.0
sounddevice 0.5.0
srt 3.5.3
tqdm 4.66.5
typing_extensions 4.12.2
urllib3 2.2.3
vosk 0.3.45
websockets 13.1
wheel 0.44.0
|
I also tried adding the virtual environment's bin and lib directories to the PATH, which was suggested on a couple of sites, but that didn't help.
Does anyone have any thoughts on how I can resolve this? |
|