speech_recognition
speech_recognition copied to clipboard
pyaudio after installation not working
I tried everything from pipwin to unofficial binary file installation and tried everything. still in cmd : import pyaudio is working but if i write import pyaudio in python IDLE it;s not working.............
please help
Originally posted by @jaydeep-shingala in https://github.com/Uberi/speech_recognition/issues/235#issuecomment-683681861
@jaydeep-shingala can you please post error
try:
import pyaudio
except Exception as err:
print(err)
#Write the above code when importing and if importing pyaudio doesn't work it will print the error in the cmd/terminal without tracebaking,then you can find the Problem why importing doesn't work. And if you can't solve please post the error.
I already installed pyaudio when I again try to install it, it shows requirement already satisfied and its location .But when I run code in Pycharm ,it shows the following error: During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/vssnr/PycharmProjects/pythonProject/main.py", line 11, in
can you send me your code to see what the error is
when i try to install pyaudio using pip command in cmd, the following is shown:
C:\windows\system32>python Python 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.
exit()
C:\windows\system32>pip install pyaudio Requirement already satisfied: pyaudio in c:\users\vssnr\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (0.2.11)
But when I use it in Pycharm it shows a module not found error. See the following code. My code in pycharm is:
import sys import speech_recognition as sr ver=sys.version print(ver) a=sr.Recognizer() message=a.listen(sr.Microphone()) print(message)
And the answer I got in the console is:
C:\Users\vssnr\PycharmProjects\pythonProject\venv\Scripts\python.exe C:/Users/vssnr/PycharmProjects/pythonProject/main.py Traceback (most recent call last): File "C:\Users\vssnr\PycharmProjects\pythonProject\venv\lib\site-packages\speech_recognition_init_.py", line 108, in get_pyaudio import pyaudio ModuleNotFoundError: No module named 'pyaudio'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/vssnr/PycharmProjects/pythonProject/main.py", line 14, in
Process finished with exit code 1
Can U please tell me the mistake where I have done and Thank You in advance.
On Mon, Nov 9, 2020 at 11:34 AM Teshan Sachintha [email protected] wrote:
can you send me your code to see what the error is
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Uberi/speech_recognition/issues/508#issuecomment-723779926, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQT5YB3NAGX6LVT4D3TNGPDSO6BANANCNFSM4QQKO6WA .
I have the same error on ubuntu 18.4
If someone still having this issue after installing python3-pyaudio this is how I solved it:
- Execute this:
sudo apt-get install portaudio19-dev python3-pyaudio
- Now install pyaudio through pip:
pip install pyaudio
- Now you should be able to use pyaudio!
This is for linux, tested in popOS (should work in ubuntu and other linux distrubtions too)
For windows pip install pipwin && pipwin install pyaudio
venv
It's in venv. Try in sublime text