'pyaudio is not installing
hey there I am working a project JARVIS and when I ran my code It gave me a error no module named pyaudio. and when I tried installing It by typing pip install pyaudio It gave me error. I am on a windows machine(windows 7)
Complete output (9 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
copying src\pyaudio.py -> build\lib.win32-3.7
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for V
isual Studio": https://visualstudio.microsoft.com/downloads/
this Is the code of my FARADAY AI. I am on python 3.8 (32 bit machine) and python is also of 32 bit.
import pyttsx3
import speech_recognition as sr
import datetime
import wikipedia
import webbrowser
import os
engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[1].id)
def speak(audio):
engine.say(audio)
engine.runAndWait()
def wishMe():
hour = int(datetime.datetime.now().hour)
if hour>=0 and hour<12:
speak('Good Morning Sir')
elif hour>=12 and hour<18:
speak('Good Afternoon sir')
else:
speak('Good Evening sir')
speak('I am Jarvis')
def takeCommand():
r = sr.Recognizer()
with sr.Microphone() as source:
print('Listening...')
r.pause_threshold = 1
audio = r.listen(source)
try:
print('Recognizing...')
query = r.recognize_google(audio, language='en')
print(f"User said: {query}\n")
except Exception as e:
print('say that again pls sir')
return "None"
return query
if __name__ == "__main__":
wishMe()
while True:
query = takeCommand().lower()
if 'wikipedia' in query:
speak('Searching wikipedia')
query = query.replace("wikipedia", "")
results = wikipedia.summary(query, sentences=2)
speak("According to Wikipedia")
print(results)
speak(results)
elif 'open Youtube in query':
webbrowser.open('youtube.com')
elif 'how handsome am i in query':
speak('you are very Handsome sir')
elif 'open Google in query':
googlePath = ("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe")
os.startfile(googlePath)
Solution 1:[1]
Unfortunately I have exactly the same problem only on a Chrombook and not get it done. If it is on a Windows system you can solve the problem quite easy:
- pip install pipwin
- pipwin install pyaudio
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | De kat |
