I am trying to install pyaudio on a Mac.
Here is what I have done:
Installed python 3.9.7
Installed homebrew
Removed portaudio (brew remove portaudio)
Installed portaudio (brew install portaudio)
Now I am trying to install pyaudio:
python3 -m pip install pyaudio
(same result for pip3 install pyaudio)
This is the error message that I get:
Collecting pyaudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Using legacy 'setup.py install' for pyaudio, since package 'wheel' is not installed.
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/hc/z83533l573lc7bbdnfqd7jzw0000gn/T/pip-install-ukm0_nma/pyaudio_11253f82c20448a3a6ab37fa24ca3049/setup.py'"'"'; __file__='"'"'/private/var/folders/hc/z83533l573lc7bbdnfqd7jzw0000gn/T/pip-install-ukm0_nma/pyaudio_11253f82c20448a3a6ab37fa24ca3049/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 /private/var/folders/hc/z83533l573lc7bbdnfqd7jzw0000gn/T/pip-record-giib8e7d/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyaudio
cwd: /private/var/folders/hc/z83533l573lc7bbdnfqd7jzw0000gn/T/pip-install-ukm0_nma/pyaudio_11253f82c20448a3a6ab37fa24ca3049/
Complete output (16 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.9
copying src/pyaudio.py -> build/lib.macosx-10.9-x86_64-3.9
running build_ext
building '_portaudio' extension
creating build/temp.macosx-10.9-x86_64-3.9
creating build/temp.macosx-10.9-x86_64-3.9/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DMACOSX=1 -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/_portaudiomodule.c -o build/temp.macosx-10.9-x86_64-3.9/src/_portaudiomodule.o
src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
#include "portaudio.h"
^~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/hc/z83533l573lc7bbdnfqd7jzw0000gn/T/pip-install-ukm0_nma/pyaudio_11253f82c20448a3a6ab37fa24ca3049/setup.py'"'"'; __file__='"'"'/private/var/folders/hc/z83533l573lc7bbdnfqd7jzw0000gn/T/pip-install-ukm0_nma/pyaudio_11253f82c20448a3a6ab37fa24ca3049/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 /private/var/folders/hc/z83533l573lc7bbdnfqd7jzw0000gn/T/pip-record-giib8e7d/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyaudio Check the logs for full command output.
WARNING: You are using pip version 21.2.3; however, version 21.2.4 is available.
You should consider upgrading via the '/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -m pip install --upgrade pip' command.
What can I do?
I have tried the various suggestions in the search engines and YouTube.
Download Pyaudio and install it manually
Download Link
Another guide
Homebrew and building PyAudio also requires installing the Command Line Tools for Xcode
Linux guide
You can use the Linux guide to install it on your mac
There are other ways too:
Use Anaconda: Install anaconda and use its package manager and other abilities.
Use Virtual Envs: Install Pyenv
Related
I have been trying to install PyAudio but I can't.
I have tried the Homebrew method and the Xcode method:
xcode-select --install
brew remove portaudio
brew install portaudio
pip3 install pyaudio
I even tried this command
pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio
I also tried
pip3 install pyaudio
and
pip install pyaudio
I keep getting this error
/Users/firassyed/opt/anaconda3/envs/env_pytorch/lib/python3.6/site-packages/pip/_internal/commands/install.py:245: UserWarning: Disabling all use of wheels due to the use of --build-option / --global-option / --install-option.
cmdoptions.check_install_build_global(options)
Collecting pyaudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Preparing metadata (setup.py) ... done
Skipping wheel build for pyaudio, due to binaries being disabled for it.
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
ERROR: Command errored out with exit status 1:
command: /Users/firassyed/opt/anaconda3/envs/env_pytorch/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-pbxf5s_a/pyaudio_3976f98c4d7440d3bbb5800ecc3b675d/setup.py'"'"'; __file__='"'"'/private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-pbxf5s_a/pyaudio_3976f98c4d7440d3bbb5800ecc3b675d/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'"'"'))' build_ext -I/usr/local/include -L/usr/local/lib install --record /private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-record-i_lptc1z/install-record.txt --single-version-externally-managed --compile --install-headers /Users/firassyed/opt/anaconda3/envs/env_pytorch/include/python3.6m/pyaudio
cwd: /private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-pbxf5s_a/pyaudio_3976f98c4d7440d3bbb5800ecc3b675d/
Complete output (11 lines):
running build_ext
building '_portaudio' extension
creating build
creating build/temp.macosx-10.9-x86_64-3.6
creating build/temp.macosx-10.9-x86_64-3.6/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/firassyed/opt/anaconda3/envs/env_pytorch/include -arch x86_64 -I/Users/firassyed/opt/anaconda3/envs/env_pytorch/include -arch x86_64 -DMACOSX=1 -I/usr/local/include -I/Users/firassyed/opt/anaconda3/envs/env_pytorch/include/python3.6m -c src/_portaudiomodule.c -o build/temp.macosx-10.9-x86_64-3.6/src/_portaudiomodule.o
src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
#include "portaudio.h"
^~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/firassyed/opt/anaconda3/envs/env_pytorch/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-pbxf5s_a/pyaudio_3976f98c4d7440d3bbb5800ecc3b675d/setup.py'"'"'; __file__='"'"'/private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-pbxf5s_a/pyaudio_3976f98c4d7440d3bbb5800ecc3b675d/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'"'"'))' build_ext -I/usr/local/include -L/usr/local/lib install --record /private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-record-i_lptc1z/install-record.txt --single-version-externally-managed --compile --install-headers /Users/firassyed/opt/anaconda3/envs/env_pytorch/include/python3.6m/pyaudio Check the logs for full command output.
Collecting pyaudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: pyaudio
Building wheel for pyaudio (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Users/firassyed/opt/anaconda3/envs/env_pytorch/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-ozic18ff/pyaudio_0f1cab72b9cf407cb344f0b0fc90d0e4/setup.py'"'"'; __file__='"'"'/private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-ozic18ff/pyaudio_0f1cab72b9cf407cb344f0b0fc90d0e4/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'"'"'))' bdist_wheel -d /private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-wheel-rw8wdejj
cwd: /private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-ozic18ff/pyaudio_0f1cab72b9cf407cb344f0b0fc90d0e4/
Complete output (16 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.6
copying src/pyaudio.py -> build/lib.macosx-10.9-x86_64-3.6
running build_ext
building '_portaudio' extension
creating build/temp.macosx-10.9-x86_64-3.6
creating build/temp.macosx-10.9-x86_64-3.6/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/firassyed/opt/anaconda3/envs/env_pytorch/include -arch x86_64 -I/Users/firassyed/opt/anaconda3/envs/env_pytorch/include -arch x86_64 -DMACOSX=1 -I/Users/firassyed/opt/anaconda3/envs/env_pytorch/include/python3.6m -c src/_portaudiomodule.c -o build/temp.macosx-10.9-x86_64-3.6/src/_portaudiomodule.o
src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
#include "portaudio.h"
^~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
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: /Users/firassyed/opt/anaconda3/envs/env_pytorch/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-ozic18ff/pyaudio_0f1cab72b9cf407cb344f0b0fc90d0e4/setup.py'"'"'; __file__='"'"'/private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-ozic18ff/pyaudio_0f1cab72b9cf407cb344f0b0fc90d0e4/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 /private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-record-9pe8tglt/install-record.txt --single-version-externally-managed --compile --install-headers /Users/firassyed/opt/anaconda3/envs/env_pytorch/include/python3.6m/pyaudio
cwd: /private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-ozic18ff/pyaudio_0f1cab72b9cf407cb344f0b0fc90d0e4/
Complete output (18 lines):
running install
/Users/firassyed/opt/anaconda3/envs/env_pytorch/lib/python3.6/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
setuptools.SetuptoolsDeprecationWarning,
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.6
copying src/pyaudio.py -> build/lib.macosx-10.9-x86_64-3.6
running build_ext
building '_portaudio' extension
creating build/temp.macosx-10.9-x86_64-3.6
creating build/temp.macosx-10.9-x86_64-3.6/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/firassyed/opt/anaconda3/envs/env_pytorch/include -arch x86_64 -I/Users/firassyed/opt/anaconda3/envs/env_pytorch/include -arch x86_64 -DMACOSX=1 -I/Users/firassyed/opt/anaconda3/envs/env_pytorch/include/python3.6m -c src/_portaudiomodule.c -o build/temp.macosx-10.9-x86_64-3.6/src/_portaudiomodule.o
src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
#include "portaudio.h"
^~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/firassyed/opt/anaconda3/envs/env_pytorch/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-ozic18ff/pyaudio_0f1cab72b9cf407cb344f0b0fc90d0e4/setup.py'"'"'; __file__='"'"'/private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-ozic18ff/pyaudio_0f1cab72b9cf407cb344f0b0fc90d0e4/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 /private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-record-9pe8tglt/install-record.txt --single-version-externally-managed --compile --install-headers /Users/firassyed/opt/anaconda3/envs/env_pytorch/include/python3.6m/pyaudio Check the logs for full command output.
Try:
pip install pipwin
pipwin install pyaudio
I am trying to download the python package fast_slic. I have downloaded the files necessary here: https://pypi.org/project/fast-slic/#files. I have also installed the Microsoft Visual Studio Installer to aid the process. This is the code I use and the error message I am receiving:
pip install fast_slic
Collecting fast_slicNote: you may need to restart the kernel to use updated packages. Using cached fast-slic-0.4.0.tar.gz (47 kB) Requirement already satisfied: numpy in c:\users\david\appdata\local\programs\python\python39\lib\site-packages (from fast_slic) (1.19.5) Building wheels for collected packages: fast-slic
ERROR: Command errored out with exit status 1: command: 'C:\Users\David\AppData\Local\Programs\Python\Python39\python.exe' -u
-c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\David\\AppData\\Local\\Temp\\pip-install-g7wsi08t\\fast-slic_eeed0754caf74386bc0ad33b27a930a6\\setup.py'"'"';
__file__='"'"'C:\\Users\\David\\AppData\\Local\\Temp\\pip-install-g7wsi08t\\fast-slic_eeed0754caf74386bc0ad33b27a930a6\\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'"'"'))' bdist_wheel -d 'C:\Users\David\AppData\Local\Temp\pip-wheel-z2t076vn'
cwd: C:\Users\David\AppData\Local\Temp\pip-install-g7wsi08t\fast-slic_eeed0754caf74386bc0ad33b27a930a6\ Complete output (30 lines): Building wheel for fast-slic (setup.py): started Building wheel for fast-slic (setup.py): finished with status 'error' Running setup.py clean for fast-slic Failed to build fast-slic Installing collected packages: fast-slic
Running setup.py install for fast-slic: started
Running setup.py install for fast-slic: finished with status 'error' running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-3.9 creating build\lib.win-amd64-3.9\cpuid copying cpuid\cpuid.py -> build\lib.win-amd64-3.9\cpuid copying cpuid\__init__.py -> build\lib.win-amd64-3.9\cpuid creating build\lib.win-amd64-3.9\fast_slic show more (open the raw output data in a text editor) ...
C:\Users\David\AppData\Local\Programs\Python\Python39\include\pyconfig.h(201): fatal error C1083: Cannot open include file: 'basetsd.h': No such file or directory
C:\Users\David\AppData\Local\Programs\Python\Python39\include\pyconfig.h(201): fatal error C1083: Cannot open include file: 'basetsd.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
---------------------------------------- ERROR: Command errored out with exit status 1: 'C:\Users\David\AppData\Local\Programs\Python\Python39\python.exe' -u
-c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\David\\AppData\\Local\\Temp\\pip-install-g7wsi08t\\fast-slic_eeed0754caf74386bc0ad33b27a930a6\\setup.py'"'"';
__file__='"'"'C:\\Users\\David\\AppData\\Local\\Temp\\pip-install-g7wsi08t\\fast-slic_eeed0754caf74386bc0ad33b27a930a6\\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\David\AppData\Local\Temp\pip-record-ik_8uebk\install-record.txt'
--single-version-externally-managed --compile --install-headers 'C:\Users\David\AppData\Local\Programs\Python\Python39\Include\fast-slic' Check the logs for full command output.
I am running windows on my laptop.
Any help is greatly appreciated
If you are in Windows try to run in the command prompt py -m pip install fast-slic?
I have figured out the problem. I think I had some corrupt files so I downloaded the Windows 10 SDK (10.0.19041.0) from Visual Studio Installer and re-ran the code
I tried installing pyaudio this way (it's probably worth noting that I'm currently using an M1 MacBook):
brew install portaudio
pip install pyaudio
and encountered this problem:
zsh: command not found: pip
Then I tried using:
python3 -m install pyaudio
and this is what happened:
Collecting pyaudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Using legacy 'setup.py install' for pyaudio, since package 'wheel' is not installed.
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/t8/c4fh02g911z6jksqbs6qlg080000gn/T/pip-install-l9y2ss43/pyaudio_082af32b7df940b88c2b176ce46b477e/setup.py'"'"'; __file__='"'"'/private/var/folders/t8/c4fh02g911z6jksqbs6qlg080000gn/T/pip-install-l9y2ss43/pyaudio_082af32b7df940b88c2b176ce46b477e/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 /private/var/folders/t8/c4fh02g911z6jksqbs6qlg080000gn/T/pip-record-9sps13ds/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyaudio
cwd: /private/var/folders/t8/c4fh02g911z6jksqbs6qlg080000gn/T/pip-install-l9y2ss43/pyaudio_082af32b7df940b88c2b176ce46b477e/
Complete output (16 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.9
copying src/pyaudio.py -> build/lib.macosx-10.9-x86_64-3.9
running build_ext
building '_portaudio' extension
creating build/temp.macosx-10.9-x86_64-3.9
creating build/temp.macosx-10.9-x86_64-3.9/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DMACOSX=1 -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/_portaudiomodule.c -o build/temp.macosx-10.9-x86_64-3.9/src/_portaudiomodule.o
src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
#include "portaudio.h"
^~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/t8/c4fh02g911z6jksqbs6qlg080000gn/T/pip-install-l9y2ss43/pyaudio_082af32b7df940b88c2b176ce46b477e/setup.py'"'"'; __file__='"'"'/private/var/folders/t8/c4fh02g911z6jksqbs6qlg080000gn/T/pip-install-l9y2ss43/pyaudio_082af32b7df940b88c2b176ce46b477e/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 /private/var/folders/t8/c4fh02g911z6jksqbs6qlg080000gn/T/pip-record-9sps13ds/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyaudio Check the logs for full command output.
Any idea how I could fix this and get pyaudio to be installed in my computer?
Trying to download PyAudio by pip install PyAudio but this isn't working. I'm using Python 3.9.5
also tried python -m pip install pyaudio but it didn't work. Anyone having the same error??
help me solve this error please...
see the code below for reference ↓
Collecting PyAudio
Using cached 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\keepa\appdata\local\programs\python\python39\python.exe' -u
-c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\keepa\\AppData\\Local\\Temp\\pip-install-e979x4nc\\pyaudio_403fcffb6b004552a1d48ac0e0876dd8\\setup.py'"'"';
__file__='"'"'C:\\Users\\keepa\\AppData\\Local\\Temp\\pip-install-e979x4nc\\pyaudio_403fcffb6b004552a1d48ac0e0876dd8\\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'"'"'))' bdist_wheel -d 'C:\Users\keepa\AppData\Local\Temp\pip-wheel-trp3euxd'
cwd: C:\Users\keepa\AppData\Local\Temp\pip-install-e979x4nc\pyaudio_403fcffb6b004552a1d48ac0e0876dd8\
Complete output (9 lines):
running bdist_wheel
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 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
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\keepa\appdata\local\programs\python\python39\python.exe' -u
-c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\keepa\\AppData\\Local\\Temp\\pip-install-e979x4nc\\pyaudio_403fcffb6b004552a1d48ac0e0876dd8\\setup.py'"'"';
__file__='"'"'C:\\Users\\keepa\\AppData\\Local\\Temp\\pip-install-e979x4nc\\pyaudio_403fcffb6b004552a1d48ac0e0876dd8\\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\keepa\AppData\Local\Temp\pip-record-isa75oeg\install-record.txt'
--single-version-externally-managed --compile --install-headers 'c:\users\keepa\appdata\local\programs\python\python39\Include\PyAudio'
cwd: C:\Users\keepa\AppData\Local\Temp\pip-install-e979x4nc\pyaudio_403fcffb6b004552a1d48ac0e0876dd8\
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 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\keepa\appdata\local\programs\python\python39\python.exe' -u
-c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\keepa\\AppData\\Local\\Temp\\pip-install-e979x4nc\\pyaudio_403fcffb6b004552a1d48ac0e0876dd8\\setup.py'"'"';
__file__='"'"'C:\\Users\\keepa\\AppData\\Local\\Temp\\pip-install-e979x4nc\\pyaudio_403fcffb6b004552a1d48ac0e0876dd8\\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\keepa\AppData\Local\Temp\pip-record-isa75oeg\install-record.txt'
--single-version-externally-managed --compile --install-headers 'c:\users\keepa\appdata\local\programs\python\python39\Include\PyAudio' Check the logs for full command output.
When running python 3.6 this works, but with python 3.7 it doesn't.
PyAudio only supports up to python 3.6:
pip will fetch and install PyAudio wheels (prepackaged binaries). Currently, there are wheels compatible with the official distributions of Python 2.7, 3.4, 3.5, and 3.6.
The workarounds would be to use a supported version of python, or to build and install manually - if the latter, you'll need to make sure you have the correct libraries installed and configured.
I should point out that PyAudio appears to be deprecated. It hasn't received an update since March 2017. Therefore I recommend you find another package for this.
Same problem due to the absence of Microsoft compiler that i didn't want to install on my PC.
I used this website unofficial pre-compiled pyaudio wheel packages, it worked well. So download wheel files at this site:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio
Of course, download the wheel version that is compatible with your python version.
use the command:
pip install wheel_file_downloaded
pip install pipwin
python -m pipwin install pyaudio
Here is the terminal line:
pip install pyaudio
Collecting pyaudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Using legacy 'setup.py install' for pyaudio, since package 'wheel' is not installed.
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/mt/2rtm41zn26x_6nxfh29s9g9w0000gn/T/pip-install-vnh5uil7/pyaudio/setup.py'"'"'; __file__='"'"'/private/var/folders/mt/2rtm41zn26x_6nxfh29s9g9w0000gn/T/pip-install-vnh5uil7/pyaudio/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/mt/2rtm41zn26x_6nxfh29s9g9w0000gn/T/pip-record-53bfxokf/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/pyaudio
cwd: /private/var/folders/mt/2rtm41zn26x_6nxfh29s9g9w0000gn/T/pip-install-vnh5uil7/pyaudio/
Complete output (13 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.8
copying src/pyaudio.py -> build/lib.macosx-10.9-x86_64-3.8
running build_ext
building '_portaudio' extension
creating build/temp.macosx-10.9-x86_64-3.8
creating build/temp.macosx-10.9-x86_64-3.8/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DMACOSX=1 -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c src/_portaudiomodule.c -o build/temp.macosx-10.9-x86_64-3.8/src/_portaudiomodule.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/mt/2rtm41zn26x_6nxfh29s9g9w0000gn/T/pip-install-vnh5uil7/pyaudio/setup.py'"'"'; __file__='"'"'/private/var/folders/mt/2rtm41zn26x_6nxfh29s9g9w0000gn/T/pip-install-vnh5uil7/pyaudio/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/mt/2rtm41zn26x_6nxfh29s9g9w0000gn/T/pip-record-53bfxokf/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/pyaudio Check the logs for full command output.
I installed port audio from brew.
Here is a thread that hopefully will help you out:
--> Pyaudio installation error - 'command 'gcc' failed with exit status 1'