Not able to install pyaudio python module - python

I can't install Pyaudio in my python 3.10.1. using pip install pipwin then pipwin install pyaudio.
Error:
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools>pipwin install pyaudio
Package `pyaudio` found in cache
Downloading package . . .
https://download.lfd.uci.edu/pythonlibs/y2rycu7g/PyAudio-0.2.11-cp310-cp310-win_amd64.whl
PyAudio-0.2.11-cp310-cp310-win_amd64.whl
Traceback (most recent call last):
File "C:\Users\ayamk\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\ayamk\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\ayamk\AppData\Local\Programs\Python\Python310\Scripts\pipwin.exe\__main__.py", line 7, in <module>
File "C:\Users\ayamk\AppData\Local\Programs\Python\Python310\lib\site-packages\pipwin\command.py", line 103, in main
cache.install(package)
File "C:\Users\ayamk\AppData\Local\Programs\Python\Python310\lib\site-packages\pipwin\pipwin.py", line 300, in install
wheel_file = self.download(requirement)
File "C:\Users\ayamk\AppData\Local\Programs\Python\Python310\lib\site-packages\pipwin\pipwin.py", line 294, in download
return self._download(requirement, dest)
File "C:\Users\ayamk\AppData\Local\Programs\Python\Python310\lib\site-packages\pipwin\pipwin.py", line 290, in _download
obj.start()
File "C:\Users\ayamk\AppData\Local\Programs\Python\Python310\lib\site-packages\pySmartDL\pySmartDL.py", line 267, in start
urlObj = urllib.request.urlopen(req, timeout=self.timeout, context=self.context)
File "C:\Users\ayamk\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 216, in urlopen
return opener.open(url, data, timeout)
File "C:\Users\ayamk\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 525, in open
response = meth(req, response)
File "C:\Users\ayamk\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 634, in http_response
response = self.parent.error(
File "C:\Users\ayamk\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 563, in error
return self._call_chain(*args)
File "C:\Users\ayamk\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 496, in _call_chain
result = func(*args)
File "C:\Users\ayamk\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 643, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

You are getting urllib.error.HTTPError: HTTP Error 404: Not Found
the .whl for pyaudio is not available at the URL pipwin is trying to download it from
Try doing pipwin refresh before doing the installation
see this github issue
Alternatively,
You can download the .whl directly from https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio
and do
pip install <path-to-downloaded-whl>

Related

Python, can not install pyaudio

I'm trying to install pyaudio in 3 ways but failed:
Solution 1
pip install pyaudio
of course, it's not working but worth a try.
Solution 2
pip install pipwin
pipwin install pyaudio
and this is what I got:
Traceback (most recent call last):
File "C:\Users\Admin\python\Python37\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\Admin\python\Python37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Admin\virtualenv\ErzaProject\Scripts\pipwin.exe\__main__.py", line 7, in <module>
File "C:\Users\Admin\virtualenv\ErzaProject\lib\site-packages\pipwin\command.py", line 98, in main
cache.install(package)
File "C:\Users\Admin\virtualenv\ErzaProject\lib\site-packages\pipwin\pipwin.py", line 300, in install
wheel_file = self.download(requirement)
File "C:\Users\Admin\virtualenv\ErzaProject\lib\site-packages\pipwin\pipwin.py", line 294, in download
return self._download(requirement, dest)
File "C:\Users\Admin\virtualenv\ErzaProject\lib\site-packages\pipwin\pipwin.py", line 290, in _download
obj.start()
File "C:\Users\Admin\virtualenv\ErzaProject\lib\site-packages\pySmartDL\pySmartDL.py", line 267, in start
urlObj = urllib.request.urlopen(req, timeout=self.timeout, context=self.context)
File "C:\Users\Admin\python\Python37\lib\urllib\request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "C:\Users\Admin\python\Python37\lib\urllib\request.py", line 525, in open
response = self._open(req, data)
File "C:\Users\Admin\python\Python37\lib\urllib\request.py", line 543, in _open
'_open', req)
File "C:\Users\Admin\python\Python37\lib\urllib\request.py", line 503, in _call_chain
result = func(*args)
File "C:\Users\Admin\python\Python37\lib\urllib\request.py", line 1360, in https_open
context=self._context, check_hostname=self._check_hostname)
File "C:\Users\Admin\python\Python37\lib\urllib\request.py", line 1319, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error timed out>
Solution 3
pip install PyAudio-0.2.11-cp36-cp36m-win_amd64.whl
and the result:
WARNING: Requirement 'PyAudio-0.2.11-cp36-cp36m-win_amd64.whl' looks like a filename, but the file does not exist
ERROR: PyAudio-0.2.11-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.
I even go to this page directly and got “ERR_CONNECTION_TIMED_OUT” error when clicking on the file.
I just wonder if there is any problem with the main page? Or it's because of my system? And any way to install pyaudio?
(I'm currently on win10 64bit)
Looking at the pypi files page for PyAudio, the latest wheels are for Python 3.6.
From your traceback it seems like you are running Python 3.7, so that won't work. The link on the pythonlibs page also times out for me.
If pip cannot find a suitable wheel, it will try to compile the package using its setup.py.
Nothing for it but to set up a development environment and compile it yourself. This link might help with that.

PyAudio and Speech Recognition not working

When I try to run speech_recognition, this happens:
C:\Users\CHERRY\WebOpener>python -m speech_recognition
Traceback (most recent call last):
File "C:\Users\CHERRY\WebOpener\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\CHERRY\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\CHERRY\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\CHERRY\WebOpener\venv\lib\site-packages\speech_recognition\__main__.py", line 4, in <module>
m = sr.Microphone()
File "C:\Users\CHERRY\WebOpener\venv\lib\site-packages\speech_recognition\__init__.py", line 79, in __init__
self.pyaudio_module = self.get_pyaudio()
File "C:\Users\CHERRY\WebOpener\venv\lib\site-packages\speech_recognition\__init__.py", line 110, in get_pyaudio
raise AttributeError("Could not find PyAudio; check installation")
AttributeError: Could not find PyAudio; check installation
But when I try to install PyAudio from the pipwin method
pip install pipwin
pipwin install pyaudio
this happens:
C:\Users\CHERRY\WebOpener>pipwin install pyaudio
Package `pyaudio` found in cache
Downloading package . . .
https://download.lfd.uci.edu/pythonlibs/q4trcu4l/PyAudio-0.2.11-cp39-cp39-win_amd64.whl
PyAudio-0.2.11-cp39-cp39-win_amd64.whl
Traceback (most recent call last):
File "C:\Users\CHERRY\WebOpener\venv\Scripts\pipwin-script.py", line 33, in <module>
sys.exit(load_entry_point('pipwin==0.5.1', 'console_scripts', 'pipwin')())
File "c:\users\cherry\webopener\venv\lib\site-packages\pipwin\command.py", line 103, in main
cache.install(package)
File "c:\users\cherry\webopener\venv\lib\site-packages\pipwin\pipwin.py", line 300, in install
wheel_file = self.download(requirement)
File "c:\users\cherry\webopener\venv\lib\site-packages\pipwin\pipwin.py", line 294, in download
return self._download(requirement, dest)
File "c:\users\cherry\webopener\venv\lib\site-packages\pipwin\pipwin.py", line 290, in _download
obj.start()
File "c:\users\cherry\webopener\venv\lib\site-packages\pySmartDL\pySmartDL.py", line 267, in start
urlObj = urllib.request.urlopen(req, timeout=self.timeout, context=self.context)
File "C:\Users\CHERRY\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 214, in urlopen
return opener.open(url, data, timeout)
File "C:\Users\CHERRY\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 523, in open
response = meth(req, response)
File "C:\Users\CHERRY\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 632, in http_response
response = self.parent.error(
File "C:\Users\CHERRY\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 561, in error
return self._call_chain(*args)
File "C:\Users\CHERRY\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 494, in _call_chain
result = func(*args)
File "C:\Users\CHERRY\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 641, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found
I don't understand. PyAudio used to download from the pipwin method. But it is not downloading. Is there another method for downloading PyAudio?
Thanks.
I had the same problem as you. I used
python -m pipwin install pyaudio

HTTP Error 403: SSL is required on trying to install gevent-psycopg2 with pip

While trying to install gevent-psycopg2 using pip On linux
Using this command:
pip install gevent-psycopg2
I got this error
Collecting gevent-psycopg2
Using cached https://files.pythonhosted.org/packages/72/11/aa122be6a3bdbc7d16752c5e6771b362ca7ebaef0f52113e036062dd2c12/gevent-psycopg2-0.0.3.tar.gz
Complete output from command python setup.py egg_info:
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.24.tar.gz
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-install-q1DRBs/gevent-psycopg2/setup.py", line 5, in
use_setuptools()
File "distribute_setup.py", line 145, in use_setuptools
return _do_download(version, download_base, to_dir, download_delay)
File "distribute_setup.py", line 124, in _do_download
to_dir, download_delay)
File "distribute_setup.py", line 193, in download_setuptools
src = urlopen(url)
File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 435, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 548, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 473, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 556, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: SSL is required
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-q1DRBs/gevent-psycopg2/
I already upgraded pip to 19.0.3 , and my python version is 2.7.12+
I tried to download the archive from git and to install it using setup.py but i end up with a similar error.
I also already tried to install using git with
pip install git+git:https://github.com/zacharyvoase/gevent-psycopg2
I dont know what i'm missing?
Or is there another way to install from source?
Thanks
The project seems to be at the early stage of development (version 0.0.3) but already abandoned (last release in 2012). The installation code uses distribute which it tries to download from http://pypi.python.org/packages/source/d/distribute/; even if the code succeeded connecting to the site it would receive error 404.
At the git repository there is the hint: "Obsolete; use https://bitbucket.org/dvarrazzo/psycogreen/ instead." The named package seems to be much more elaborated (version 1.0.1) and fresh (Dec 2018). So start with
pip install psycogreen

Error HTTP Error 403: SSL is required when pip installing MySQL-python

I'm having a problem pip installing MySQL Python on my server.
Full stack trace is as follows:
(ENV)[fendyhj#web530 lepaperville]$ pip install MySQL-python
Downloading/unpacking MySQL-python
Running setup.py egg_info for package MySQL-python
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/home/fendyhj/webapps/lepaperville/ENV/build/MySQL-python/setup.py", line 7, in <module>
use_setuptools()
File "distribute_setup.py", line 145, in use_setuptools
return _do_download(version, download_base, to_dir, download_delay)
File "distribute_setup.py", line 124, in _do_download
to_dir, download_delay)
File "distribute_setup.py", line 194, in download_setuptools
src = urlopen(url)
File "/usr/local/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/lib/python2.7/urllib2.py", line 437, in open
response = meth(req, response)
File "/usr/local/lib/python2.7/urllib2.py", line 550, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/local/lib/python2.7/urllib2.py", line 475, in error
return self._call_chain(*args)
File "/usr/local/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/usr/local/lib/python2.7/urllib2.py", line 558, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: SSL is required
Complete output from command python setup.py egg_info:
Downloading
http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
urllib2.HTTPError: HTTP Error 403: SSL is required
Anyone know how to install MySQL Python through HTTPS ?
Any help would be appreciated, Thanks !
Looks like python is missing the ssl bindings, I would make sure ssl is installed and reinstall python. If it does not work you can compile python yourself https://askubuntu.com/questions/21547/what-are-the-packages-libraries-i-should-install-before-compiling-python-from-so
you can get tar package from https://dev.mysql.com/downloads/connector/python/, and install it manually
The solution is finally to install mysqlclient instead, as MySQL Python hasn't been updated since 2014, credit to #alasdair

How to pass proxy to pythonbrew for downloading setuptools?

I installed pythonbrew on an ubuntu precise system. Had some issues using proxy during the installation (see an earlier post). Now I'm able to install different versions of python and switch between them, however setuptools is not installed during python installation:
ERROR: Failed to install setuptools. See /usr/local/pythonbrew/log/build.log to see why.
Skip installation of setuptools.
The build.log contains:
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.49.tar.gz
Traceback (most recent call last):
File "distribute_setup.py", line 556, in <module>
sys.exit(main())
File "distribute_setup.py", line 552, in main
tarball = download_setuptools(download_base=options.download_base)
File "distribute_setup.py", line 211, in download_setuptools
src = urlopen(url)
File "/usr/local/pythonbrew/pythons/Python-2.6/lib/python2.6/urllib2.py", line 124, in urlopen
return _opener.open(url, data, timeout)
File "/usr/local/pythonbrew/pythons/Python-2.6/lib/python2.6/urllib2.py", line 389, in open
response = meth(req, response)
File "/usr/local/pythonbrew/pythons/Python-2.6/lib/python2.6/urllib2.py", line 502, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/local/pythonbrew/pythons/Python-2.6/lib/python2.6/urllib2.py", line 421, in error
result = self._call_chain(*args)
File "/usr/local/pythonbrew/pythons/Python-2.6/lib/python2.6/urllib2.py", line 361, in _call_chain
result = func(*args)
File "/usr/local/pythonbrew/pythons/Python-2.6/lib/python2.6/urllib2.py", line 597, in http_error_302
return self.parent.open(new)
File "/usr/local/pythonbrew/pythons/Python-2.6/lib/python2.6/urllib2.py", line 383, in open
response = self._open(req, data)
File "/usr/local/pythonbrew/pythons/Python-2.6/lib/python2.6/urllib2.py", line 401, in _open
'_open', req)
File "/usr/local/pythonbrew/pythons/Python-2.6/lib/python2.6/urllib2.py", line 361, in _call_chain
result = func(*args)
File "/usr/local/pythonbrew/pythons/Python-2.6/lib/python2.6/urllib2.py", line 1138, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/usr/local/pythonbrew/pythons/Python-2.6/lib/python2.6/urllib2.py", line 1105, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno 110] Connection timed out>
Looks to me like the issue is with the proxy again and I'm not sure what script to modify so that the setuptools installation uses my proxy. I modified distribute_setup.py and added proxy information there (based on this post), but it looks like this file is overwritten each time pythonbrew install is called. I am new to python and can't find where this file is generated from. Any pointers as to how I can pass proxy to the setuptools part of the installation will be greatly appreciated.
Setting HTTP_PROXY and HTTPS_PROXY in the env solved this particular problem (after that the error changed from 110 to 113; for a follow up see this other question).

Categories