ardha27 / AI-Waifu-Vtuber

AI Vtuber for Streaming on Youtube/Twitch
800 stars 127 forks source link

Failed building wheel for PyAudio #49

Open JaxSie opened 1 year ago

JaxSie commented 1 year ago

tried 3 times and failed all 3 times. first is just following the installation process but didnt work. then i pip install PyAudio and tried again whick also didnt work

INFO: pip is looking at multiple versions of httpx[http2] to determine which version is compatible with other requirements. This could take a while. Collecting httpx[http2] (from pytchat==0.5.5->-r requirements.txt (line 9)) Using cached httpx-0.23.3-py3-none-any.whl (71 kB) Using cached httpx-0.23.2-py3-none-any.whl (86 kB) Using cached httpx-0.23.1-py3-none-any.whl (84 kB) Using cached httpx-0.23.0-py3-none-any.whl (84 kB) Using cached httpx-0.22.0-py3-none-any.whl (84 kB) Using cached httpx-0.21.3-py3-none-any.whl (83 kB) Using cached httpx-0.21.2-py3-none-any.whl (83 kB) INFO: pip is looking at multiple versions of httpx[http2] to determine which version is compatible with other requirements. This could take a while. Using cached httpx-0.21.1-py3-none-any.whl (83 kB) Using cached httpx-0.21.0-py3-none-any.whl (83 kB) Using cached httpx-0.20.0-py3-none-any.whl (82 kB) Using cached httpx-0.19.0-py3-none-any.whl (77 kB) Using cached httpx-0.18.2-py3-none-any.whl (76 kB) INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C. Using cached httpx-0.18.1-py3-none-any.whl (75 kB) Using cached httpx-0.18.0-py3-none-any.whl (75 kB) Using cached httpx-0.17.1-py3-none-any.whl (68 kB) Using cached httpx-0.17.0-py3-none-any.whl (68 kB) Using cached httpx-0.16.1-py3-none-any.whl (65 kB) Using cached httpx-0.16.0-py3-none-any.whl (65 kB) Using cached httpx-0.15.5-py3-none-any.whl (65 kB) Using cached httpx-0.15.4-py3-none-any.whl (65 kB) Using cached httpx-0.15.3-py3-none-any.whl (64 kB) Using cached httpx-0.15.2-py3-none-any.whl (64 kB) Using cached httpx-0.15.1-py3-none-any.whl (64 kB) Using cached httpx-0.15.0-py3-none-any.whl (64 kB) Using cached httpx-0.14.3-py3-none-any.whl (62 kB) Using cached httpx-0.14.2-py3-none-any.whl (61 kB) Using cached httpx-0.14.1-py3-none-any.whl (60 kB) Using cached httpx-0.14.0-py3-none-any.whl (59 kB) WARNING: httpx 0.13.3 does not provide the extra 'http2' Building wheels for collected packages: PyAudio 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 ╰─> [17 lines of output] running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-cpython-310 copying src\pyaudio.py -> build\lib.win-amd64-cpython-310 running build_ext building '_portaudio' extension creating build\temp.win-amd64-cpython-310 creating build\temp.win-amd64-cpython-310\Release creating build\temp.win-amd64-cpython-310\Release\src "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DMS_WIN64=1 -IC:\Users\pc\AppData\Local\Programs\Python\Python310\include -IC:\Users\pc\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" /Tcsrc/_portaudiomodule.c /Fobuild\temp.win-amd64-cpython-310\Release\src/_portaudiomodule.obj _portaudiomodule.c C:\Users\pc\AppData\Local\Programs\Python\Python310\include\pyconfig.h(117): warning C4005: 'MS_WIN64': macro redefinition C:\Users\pc\AppData\Local\Programs\Python\Python310\include\pyconfig.h(117): note: 'MS_WIN64' previously declared on the command line src/_portaudiomodule.c(29): fatal error C1083: Cannot open include file: 'portaudio.h': No such file or directory error: command 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe' failed with exit code 2 [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

ANGELELF708 commented 1 year ago

Hey, did some research and found this StackOverflow post: https://stackoverflow.com/questions/69711732/pyaudio-install-error-failed-building-wheel

In this they explain that if you are using mac you should run these two commands in order:

brew install portaudio
pip install pyaudio

Other wise they reccommend running:

pip install PyAudio

Finally if that still doesn't work try:

python setup.py install

If somehow none of that works, then I would probably do the following:

  1. Check which version of python you are running

python --version

  1. Are you running in your active virtual environment (I don't know why this would effect anything, but it never hurts to check)

  2. Does it even work on your operating system? (specifically your version of the operating system. I run a discord bot off my 2000 year old macbook, and sometimes dependencies just plain don't work on there. If you're running anything relatively new I probably wouldn't worry too much about it.)

Sorry, installation errors like this suck, and most of the time you just have to try things until they work. If all else fails, sometimes I like to feed the error message to ChatGPT, after a couple rounds sometimes it just works. Hopefully I helped! To be clear I just stumbled across this repository so I'm not entirely familiar with it's dependencies, and I've never used PyAudio to my memory.

JaxSie commented 1 year ago

well firstly thx for replying and trying to help, and im using windows 11, on a 2021 rog strix laptop fyi. after trying all that i got:

AI-Waifu-Vtuber>pip install PyAudio Requirement already satisfied: PyAudio in c:\users\pc\appdata\local\programs\python\python310\lib\site-packages (0.2.13)

AI-Waifu-Vtuber>python --version Python 3.10.6

AI-Waifu-Vtuber>python run.py Traceback (most recent call last): File "[redacted]\AI-Waifu-Vtuber\run.py", line 4, in import pytchat ModuleNotFoundError: No module named 'pytchat'

then i tested pip install pytchat and ran the .bat again and got

AI-Waifu-Vtuber>python run.py Traceback (most recent call last): File "[redacted]\AI-Waifu-Vtuber\run.py", line 8, in import keyboard ModuleNotFoundError: No module named 'keyboard'

so we know where this is going.. i installed them and emoji then ran .bat again

which gave me yet ANOTHER error. im going back to my llama.cpp until this ai vtuber installation process gets improve.. thx for ur help!

Sylensar commented 1 year ago

@ANGELELF708 greetings. Would you happen to have the fix for any of the module errors?

chumagram commented 1 year ago

I can resolve that problem. First ejecute: sudo apt-get install portaudio19-dev Next, ejecute: pip install pyaudio

viktorblack commented 1 year ago

this seems to have fixed it for me

pip install pipwin

pipwin install pyaudio

YSyashsharma commented 12 months ago

pipwin install pyaudio

not working in Mac

summersonne commented 12 months ago

In a windows11

pip install pipwin pipwin install pyaudio pip install -r requirements.txt

worked for me

eliasinacio commented 10 months ago

I can resolve that problem. First ejecute: sudo apt-get install portaudio19-dev Next, ejecute: pip install pyaudio

Worked here :)

Why?

shizukanaskytree commented 7 months ago

conda install pyaudio

plore77 commented 6 months ago

conda install pyaudio

It works for me

karthik-dev6776 commented 6 months ago

I can resolve that problem. First ejecute: sudo apt-get install portaudio19-dev Next, ejecute: pip install pyaudio what is passcode for it then

shankarkarande commented 6 months ago

I can resolve that problem. First ejecute: sudo apt-get install portaudio19-dev Next, ejecute: pip install pyaudio

Thanx It worked for me !!