I'm on windows 10 wsl2, python 3.8.10, and I tried installing pyaudio and portaudio via pip and pipwin3, which didn't work. Then I installed portaudio from the website. After I tried this. I used this instead though since portaudio was in my working directory:
pip install --global-option='build_ext' --global-option='-I/portaudio/include' --global-option='-L/baili/local/lib' pyaudio
Got this error now:
Defaulting to user installation because normal site-packages is not writeable
WARNING: Implying --no-binary=:all: due to the presence of --build-option / --global-option / --install-option. Consider using --config-settings for more flexibility.
DEPRECATION: --no-binary currently disables reading from the cache of locally built wheels. In the future --no-binary will not influence the wheel cache. pip 23.1 will enforce this behaviour change. A possible replacement is to use the --no-cache-dir option. You can use the flag --use-feature=no-binary-enable-wheel-cache to test the upcoming behaviour. Discussion can be found at https://github.com/pypa/pip/issues/11453
Collecting pyaudio
Using cached PyAudio-0.2.12.tar.gz (42 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pyaudio
WARNING: Ignoring --global-option when building pyaudio using PEP 517
Building wheel for pyaudio (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pyaudio (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [16 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-38
copying src/pyaudio.py -> build/lib.linux-x86_64-cpython-38
running build_ext
building '_portaudio' extension
creating build/temp.linux-x86_64-cpython-38
creating build/temp.linux-x86_64-cpython-38/src
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/local/include -I/usr/include -I/usr/include/python3.8 -c src/_portaudiomodule.c -o build/temp.linux-x86_64-cpython-38/src/_portaudiomodule.o
src/_portaudiomodule.c:31:10: fatal error: portaudio.h: No such file or directory
31 | #include "portaudio.h"
| ^~~~~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyaudio
Failed to build pyaudio
ERROR: Could not build wheels for pyaudio, which is required to install pyproject.toml-based projects
I'm lost right now, if you have a link to the pyaudio file it'd be cool, or a fix to this thanks
pipwin, pip, pip3, website
pip install PyAudio‑0.2.11‑cp37‑cp37m‑win_amd64.whl
I found the answer to be quite simple:
conda install -c anaconda pyaudio
this also made me realize that I forgot to put conda in my sys environment variables :P