How to install Pyaudio with Pyinstaller?

I am trying to convert a .py script to a .exe application using pyinstaller.

These are the libraries I am using:

import winsound
import cv2
import dlib
import imutils
import pyttsx3
import speech_recognition as sr
from imutils import face_utils
from scipy.spatial import distance
import time

Everything works perfectly in my application(that doesn't use pyaudio) but the part where I use Pyaudio to listen to the microphone and convert that to text using speech_recognition library doesn't work.

This is the error:

Image:

enter image description here

OCR of error:

Unhandled exception in script
Failed to execute script 'test1_error_handling' due to unhandled
exception: [WinError 6] The handle is invalid
Traceback (most recent call last):
File "test1_error_handling.py", line 80, in <module>
text= r.recognize google(audio_tert)
File "speech_recognition_init-py", line 828, in recognizegoogle
File "speech_recognition_init -py", line 457, in get flac data
File "subprocess.py", line 753, in _init_
File "subprocess.py", line 1090, in_get_handles
OSError: [WinError 6] The handle is invalid

I think this is related to speech_recognition library and pyaudio library not being installed correctly because you need a .whl file for installing pyaudio locally. Do I change the .spec file that is created by pyinstaller? How can I install the pyaudio .whl in pyinstaller? How can I fix this error?

version: python=3.7.9, latest pyinstaller version



from Recent Questions - Stack Overflow https://ift.tt/3qi6M7G
https://ift.tt/3rc6EGa

Comments

Popular posts from this blog

Spring Elasticsearch Operations

Network Error and Timeout on Authorize.net JS

Object oriented programming concepts (OOPs)