nihal111/J.A.R.V.I.S

Systax error

Opened this issue · 3 comments

C:\Users\Cheran\Desktop\python\J.A.R.V.I.S>python script.py
File "script.py", line 52
print r.recognize_google(audio)
^
SyntaxError: invalid syntax

why am facing this error?

print (r.recognize_google(audio))
this code supports python 2.x and not 3.x
so you have to make required changes

File "script.py", line 102
print "J.A.R.V.I.S: " + jarvis_speech
syntax error and i am not able install the pip install pyaudio

i am getting this error
Running setup.py install for pyaudio ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\lenovo\appdata\local\programs\python\python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\lenovo\AppData\Local\Temp\pip-install-363fiovt\pyaudio_acd1240551984f49b91f1430d22a7b7d\setup.py'"'"'; file='"'"'C:\Users\lenovo\AppData\Local\Temp\pip-install-363fiovt\pyaudio_acd1240551984f49b91f1430d22a7b7d\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\lenovo\AppData\Local\Temp\pip-record-c23qkm0k\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\lenovo\appdata\local\programs\python\python39\Include\pyaudio'
cwd: C:\Users\lenovo\AppData\Local\Temp\pip-install-363fiovt\pyaudio_acd1240551984f49b91f1430d22a7b7d
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 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\lenovo\appdata\local\programs\python\python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\lenovo\AppData\Local\Temp\pip-install-363fiovt\pyaudio_acd1240551984f49b91f1430d22a7b7d\setup.py'"'"'; file='"'"'C:\Users\lenovo\AppData\Local\Temp\pip-install-363fiovt\pyaudio_acd1240551984f49b91f1430d22a7b7d\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\lenovo\AppData\Local\Temp\pip-record-c23qkm0k\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\lenovo\appdata\local\programs\python\python39\Include\pyaudio' Check the logs for full command output.

you should be having latest version of visual c++(v14 above) installed in your computer.
refer to this link below to solve this issue...
https://stackoverflow.com/questions/48541801/microsoft-visual-c-14-0-is-required-get-it-with-microsoft-visual-c-build-t
or
watch this video(link given below)
https://youtu.be/vc2x3q4k8BY