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.
Related
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>
when I try to install build with
sudo pip3 install build
the following error occurs:
Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line 143, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 386, in run
use_user_site=options.use_user_site,
File "/usr/lib/python3/dist-packages/pip/_internal/req/__init__.py", line 49, in install_given_reqs
**kwargs
File "/usr/lib/python3/dist-packages/pip/_internal/req/req_install.py", line 760, in install
use_user_site=use_user_site, pycompile=pycompile,
File "/usr/lib/python3/dist-packages/pip/_internal/req/req_install.py", line 382, in move_wheel_files
warn_script_location=warn_script_location,
File "/usr/lib/python3/dist-packages/pip/_internal/wheel.py", line 215, in move_wheel_files
prefix=prefix,
File "/usr/lib/python3/dist-packages/pip/_internal/locations.py", line 153, in distutils_scheme
d.parse_config_files()
File "/usr/lib/python3.7/distutils/dist.py", line 406, in parse_config_files
parser.read(filename)
File "/usr/lib/python3.7/configparser.py", line 696, in read
self._read(fp, filename)
File "/usr/lib/python3.7/configparser.py", line 1091, in _read
fpname, lineno)
configparser.DuplicateOptionError: While reading from 'setup.cfg' [line 10]: option 'url' in section 'metadata' already exists
while installing the collected packages. The install never completes; pip says it was never installed. I would greatly appreciate any help troubleshooting.
In the off chance anyone else has this problem, I found a temporary fix that will probably make python stop working in a few days.. I went to ln 1088-1090 of /usr/lib/python3.7/configparser.py and replaced that bit about raising an exception after an if statement with
while (self._strict and
(sectname, optname) in elements_added):
elements_added.pop()
This seemed to have fixed the problem, albeit not in the most pretty method, as installation pf build and use of sdist now works ok.
I tried to install scrapy on my windows machine by using pip install scrapy and pip3 install scrapy but it is showing me the following error:
File "<string>", line 1, in <module>
File "C:\Users\ASUS\AppData\Local\Temp\pip-install-8lbz4g3u\Twisted\setup.py", line 20, in <module>
setuptools.setup(**_setup["getSetupArgs"]())
File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\__init__.py", line 144, in setup
_install_setup_requires(attrs)
File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\__init__.py", line 139, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\dist.py", line 716, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
File "c:\users\asus\desktop\utube\venv\lib\site-packages\pkg_resources\__init__.py", line 780, in resolve
dist = best[req.key] = env.best_match(
File "c:\users\asus\desktop\utube\venv\lib\site-packages\pkg_resources\__init__.py", line 1065, in best_match
return self.obtain(req, installer)
File "c:\users\asus\desktop\utube\venv\lib\site-packages\pkg_resources\__init__.py", line 1077, in obtain
return installer(requirement)
File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\dist.py", line 786, in fetch_build_egg
return cmd.easy_install(req)
File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\command\easy_install.py", line 665, in easy_install
dist = self.package_index.fetch_distribution(
File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\package_index.py", line 655, in fetch_distribution
dist = find(requirement)
File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\package_index.py", line 635, in find
loc = self.download(dist.location, tmpdir)
File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\package_index.py", line 579, in download
found = self._download_url(scheme.group(1), spec, tmpdir)
File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\package_index.py", line 824, in _download_url
return self._attempt_download(url, filename)
File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\package_index.py", line 830, in _attempt_download
headers = self._download_to(url, filename)
File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\package_index.py", line 729, in _download_to
fp = self.open_url(url)
File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\package_index.py", line 779, in open_url
raise DistutilsError("Download error for %s: %s"
distutils.errors.DistutilsError: Download error for https://files.pythonhosted.org/packages/f5/1d/c98a587dc06e107115cf4a58b49de20b19222c83d7533
5a192052af4c4b7/incremental-17.5.0-py2.py3-none-any.whl#sha256=717e12246dddf231a349175f48d74d93e2897244939173b01974ab6661406b9f: _ssl.c:1091: The h
andshake operation timed out
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
So help me out how to fix this problem.
I have tried to install from pycharm also but it can't install there also
Based on the traceback you provided and this Github Issue the issue appears to be the "incremental" package dependency. You can try installing incremental (17.5.0) using pip install incremental==17.5.0 before installing scrapy.
Note that in the scrapy documentation installation guide it says:
"Though it’s possible to install Scrapy on Windows using pip, we
recommend you to install Anaconda or Miniconda and use the package
from the conda-forge channel, which will avoid most installation
issues."
So you could follow the steps in the documentation if installing incremental doesn't resolve your issues.
I am unable to install youtube-dl-api-server. I am using Python 2.7.9. It looks like there is a bug in some dependency. I have tried install from source code but I was with the same result. After running command pip install –pre youtube_dl_server I got this message:
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 257, in run
InstallRequirement.from_line(name, None))
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 172, in from_line
return cls(req, comes_from, url=url, prereleases=prereleases)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 70, in __init__
req = pkg_resources.Requirement.parse(req)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2667, in parse
reqs = list(parse_requirements(s))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2593, in parse_requirements
raise ValueError("Missing distribution spec", line)
ValueError: ('Missing distribution spec', '\xe2\x80\x93r')
Storing debug log for failure in /home/ubuntu/.pip/pip.log
I am using Python 2.7.9 on Ununtu Server. Do you have any idea how to solve this?
Thanks metjuf
There is a strange character in your command, most likely the result of some automatic conversion. I'm talking about – (U+8211, b'\xe2\x80\x93' as UTF-8). So instead of
pip install –pre youtube_dl_server
run
pip install --pre youtube_dl_server
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).