Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I get "HTTP Error 404: Not Found" when installing pyaudio with pipwin in Python Django project in Windows 10?

I'm trying to install pyaudio with pipwin in a Python Django project in Windows 10.

I first run CMD as admin in Windows 10. Then I run the command:

pipwin install pyaudio

and I get the following error:

raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

the full output from the command:

Package `pyaudio` found in cache
Downloading package . . .
https://download.lfd.uci.edu/pythonlibs/z4tqcw5k/PyAudio-0.2.11-cp38-cp38-win_amd64.whl
PyAudio-0.2.11-cp38-cp38-win_amd64.whl
Traceback (most recent call last):
  File "C:\Users\...\AppData\Local\Programs\Python\Python38\Scripts\pipwin-script.py", line 11, in <module>
    load_entry_point('pipwin==0.5.1', 'console_scripts', 'pipwin')()
  File "c:\users\...\appdata\local\programs\python\python38\lib\site-packages\pipwin\command.py", line 103, in main
    cache.install(package)
  File "c:\users\...\appdata\local\programs\python\python38\lib\site-packages\pipwin\pipwin.py", line 300, in install
    wheel_file = self.download(requirement)
  File "c:\users\...\appdata\local\programs\python\python38\lib\site-packages\pipwin\pipwin.py", line 294, in download
    return self._download(requirement, dest)
  File "c:\users\...\appdata\local\programs\python\python38\lib\site-packages\pipwin\pipwin.py", line 290, in _download
    obj.start()
  File "c:\users\...\appdata\local\programs\python\python38\lib\site-packages\pySmartDL\pySmartDL.py", line 267, in start
    urlObj = urllib.request.urlopen(req, timeout=self.timeout, context=self.context)
  File "c:\users\...\appdata\local\programs\python\python38\lib\urllib\request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "c:\users\...\appdata\local\programs\python\python38\lib\urllib\request.py", line 531, in open
    response = meth(req, response)
  File "c:\users\...\appdata\local\programs\python\python38\lib\urllib\request.py", line 640, in http_response
    response = self.parent.error(
  File "c:\users\...\appdata\local\programs\python\python38\lib\urllib\request.py", line 569, in error
    return self._call_chain(*args)
  File "c:\users\...\appdata\local\programs\python\python38\lib\urllib\request.py", line 502, in _call_chain
    result = func(*args)
  File "c:\users\...\appdata\local\programs\python\python38\lib\urllib\request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

Why can I not install pyaudio?

Thanks!

Update

I tried running this command now (pipwin´ doesn't seem to have the --no-cache-dir option`):

pip install pyaudio --no-cache-dir

and get the following error(s) and output:

Collecting pyaudio
  Downloading PyAudio-0.2.11.tar.gz (37 kB)
Building wheels for collected packages: pyaudio
  Building wheel for pyaudio (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\...\Documents\django\...\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\...\\AppData\\Local\\Temp\\pip-install-hmxqj031\\pyaudio_26cdeab02ee14fec8d9e424e45453600\\setup.py'"'"'; __file__='"'"'C:\\Users\\...\\AppData\\Local\\Temp\\pip-install-hmxqj031\\pyaudio_26cdeab02ee14fec8d9e424e45453600\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\...\AppData\Local\Temp\pip-wheel-2z9ppsu6'
       cwd: C:\Users\...\AppData\Local\Temp\pip-install-hmxqj031\pyaudio_26cdeab02ee14fec8d9e424e45453600\
  Complete output (17 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.8
  copying src\pyaudio.py -> build\lib.win-amd64-3.8
  running build_ext
  building '_portaudio' extension
  creating build\temp.win-amd64-3.8
  creating build\temp.win-amd64-3.8\Release
  creating build\temp.win-amd64-3.8\Release\src
  C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMS_WIN64=1 -IC:\Users\...\Documents\django\...\include -Ic:\users\...\appdata\local\programs\python\python38\include -Ic:\users\...\appdata\local\programs\python\python38\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcsrc/_portaudiomodule.c /Fobuild\temp.win-amd64-3.8\Release\src/_portaudiomodule.obj
  _portaudiomodule.c
  c:\users\...\appdata\local\programs\python\python38\include\pyconfig.h(117): warning C4005: 'MS_WIN64': macro redefinition
  src/_portaudiomodule.c: note: see previous definition of 'MS_WIN64'
  src/_portaudiomodule.c(29): fatal error C1083: Cannot open include file: 'portaudio.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29910\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
  ----------------------------------------
  ERROR: Failed building wheel for pyaudio
  Running setup.py clean for pyaudio
Failed to build pyaudio
Installing collected packages: pyaudio
    Running setup.py install for pyaudio ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\...\Documents\django\...\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\...\\AppData\\Local\\Temp\\pip-install-hmxqj031\\pyaudio_26cdeab02ee14fec8d9e424e45453600\\setup.py'"'"'; __file__='"'"'C:\\Users\\...\\AppData\\Local\\Temp\\pip-install-hmxqj031\\pyaudio_26cdeab02ee14fec8d9e424e45453600\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\...\AppData\Local\Temp\pip-record-r1bi5b8i\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\...\Documents\django\...\include\site\python3.8\pyaudio'
         cwd: C:\Users\...\AppData\Local\Temp\pip-install-hmxqj031\pyaudio_26cdeab02ee14fec8d9e424e45453600\
    Complete output (17 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.8
    copying src\pyaudio.py -> build\lib.win-amd64-3.8
    running build_ext
    building '_portaudio' extension
    creating build\temp.win-amd64-3.8
    creating build\temp.win-amd64-3.8\Release
    creating build\temp.win-amd64-3.8\Release\src
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMS_WIN64=1 -IC:\Users\...\Documents\django\...\include -Ic:\users\...\appdata\local\programs\python\python38\include -Ic:\users\...\appdata\local\programs\python\python38\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcsrc/_portaudiomodule.c /Fobuild\temp.win-amd64-3.8\Release\src/_portaudiomodule.obj
    _portaudiomodule.c
    c:\users\...\appdata\local\programs\python\python38\include\pyconfig.h(117): warning C4005: 'MS_WIN64': macro redefinition
    src/_portaudiomodule.c: note: see previous definition of 'MS_WIN64'
    src/_portaudiomodule.c(29): fatal error C1083: Cannot open include file: 'portaudio.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29910\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\...\Documents\django\...\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\...\\AppData\\Local\\Temp\\pip-install-hmxqj031\\pyaudio_26cdeab02ee14fec8d9e424e45453600\\setup.py'"'"'; __file__='"'"'C:\\Users\\...\\AppData\\Local\\Temp\\pip-install-hmxqj031\\pyaudio_26cdeab02ee14fec8d9e424e45453600\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\...\AppData\Local\Temp\pip-record-r1bi5b8i\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\...\Documents\django\...\include\site\python3.8\pyaudio' Check the logs for full command output.
WARNING: You are using pip version 20.3.3; however, version 21.0.1 is available.
You should consider upgrading via the 'C:\Users\...\Documents\django\...\Scripts\python.exe -m pip install --upgrade pip' command.
like image 265
EggBender Avatar asked Jan 25 '23 10:01

EggBender


1 Answers

This is a problem not necessarily related to pyaudio. Try:

pipwin refresh

and then install what ever you want using pipwin.

like image 73
Hekd Avatar answered Feb 03 '23 06:02

Hekd