Search code examples
pythonpyaudio

pyaudio installed, "No module named 'pyaudio'"


$ python -m pip install pyaudio
Requirement already satisfied: pyaudio in c:\users\user\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (0.2.11)

$ py sound.py
Traceback (most recent call last):
  File "sound.py", line 1, in <module>
    import pyaudio
ModuleNotFoundError: No module named 'pyaudio'

pyaudio was installed via a .whl file. This is on Windows 10, python version 3.8.5


Solution

  • this mostly happens if you have installed two python versions.

    here you are using "python". $ python -m pip install pyaudio

    and to execute you are using "py". $ py sound.py

    run it using python sound.py