Buongiorno a tutti,
vorrei provare a cimentarmi un po' nell'ambito del riconoscimento vocale in Python e per prima cosa, come consigliatomi da alcune guide, ho installato speech_recognition. L'installazione non ha avuto intoppi ma quando mi sono ritrovato ad utilizzarla concretamente mi dava un errore ogni sua funzione. Mi diceva che era richiesto un certo PyAudio e subito ho provato ad installarlo ma ho ricevuto non pochi errori nell'installazione. Ho provato sia sul mio computer Windows che sul mio Linux e ho, in entrambi, ottenuto questo errore molto lungo:
WARNING: Value for scheme.headers does not match. Please report this to <https://github.com/pypa/pip/issues/9617>
distutils: c:\program files\python39\Include\UNKNOWN
sysconfig: c:\program files\python39\Include
WARNING: Additional context:
user = False
home = None
root = None
prefix = None
Defaulting to user installation because normal site-packages is not writeable
Collecting pyaudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Using legacy 'setup.py install' for pyaudio, since package 'wheel' is not installed.
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
ERROR: Command errored out with exit status 1:
command: 'c:\program files\python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\pietr\\AppData\\Local\\Temp\\pip-install-y9gn14c8\\pyaudio_cdb5319f1a6e454abd7cf26c957ba678\\setup.py'"'"'; __file__='"'"'C:\\Users\\pietr\\AppData\\Local\\Temp\\pip-install-y9gn14c8\\pyaudio_cdb5319f1a6e454abd7cf26c957ba678\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\pietr\AppData\Local\Temp\pip-record-730xokll\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\pietr\AppData\Roaming\Python\Python39\Include\pyaudio'
cwd: C:\Users\pietr\AppData\Local\Temp\pip-install-y9gn14c8\pyaudio_cdb5319f1a6e454abd7cf26c957ba678\
Complete output (9 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
copying src\pyaudio.py -> build\lib.win-amd64-3.9
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\program files\python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\pietr\\AppData\\Local\\Temp\\pip-install-y9gn14c8\\pyaudio_cdb5319f1a6e454abd7cf26c957ba678\\setup.py'"'"'; __file__='"'"'C:\\Users\\pietr\\AppData\\Local\\Temp\\pip-install-y9gn14c8\\pyaudio_cdb5319f1a6e454abd7cf26c957ba678\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\pietr\AppData\Local\Temp\pip-record-730xokll\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\pietr\AppData\Roaming\Python\Python39\Include\pyaudio' Check the logs for full command output.
Potreste darmi una mano e dirmi dove, io o il mio computer, stiamo sbagliando?
Grazie in anticipo