[Python] I am using pyvidplayer2, and it is giving me an error of me not having pyaudio, but I...

Discussão em 'Python' iniciado por Stack, Julho 21, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to learn pygame for a game I am making for a school project, and one of the things I am trying to learn is how to play a video in pygame. So I tried to use the library pyvidplayer2, and it gave me an error, and said I needed to download pyaudio.

    So I downloaded pyaudio using:

    brew install portaudio pip install pyaudio But it is still giving me the same error which is:

    Traceback (most recent call last):
    File "/Users/rishanbanerjee/PyCharmMiscProject/script1.py", line 22, in <module>
    cricket_video = Video("cricket_video.mp4")
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Users/rishanbanerjee/PyCharmMiscProject/pyvidplayer2/video_pygame.py", line 20, in __init__
    Video.__init__(self, path, chunk_size, max_threads, max_chunks, subs, post_process, interp, use_pygame_audio,
    File "/Users/rishanbanerjee/PyCharmMiscProject/pyvidplayer2/video.py", line 184, in __init__
    raise ModuleNotFoundError(
    ModuleNotFoundError: Unable to use PyAudio audio because PyAudio is not installed. PyAudio can be installed via pip.


    So I found the line it was giving me an error on which was: self._audio._set_device_index(self.audio_index) As this had a yellow line below the part that is not in the bracket.

    Can anyone help me?

    Continue reading...

Compartilhe esta Página