0

I have used pip to install PyAudio, yet when I try to import it using import pyaudio, I get the following error message

ImportError : No module named PyAudio.

I tried to reinstall PyAudio, and it says that I already have it installed.

Louis Gaumond
  • 13
  • 1
  • 4

1 Answers1

1
  1. Please ensure you use import pyaudio, and not import PyAudio (as the error message suggests). Python is case sensitive.
  2. This scenario can also be caused if you have multiple Python environments installed on your machine.

Some of the environment problems can be checked in the following way - open cmd and run:

where python
where pip

pip should be in the same directory as Python, under the "Scripts" folder.

If you find that the path to pip and the path to Python are completely different, some possible solutions are:

  1. Change your current working directory in the cmd using cd. Make it point to the location of the correct pip. Then run pip install.
  2. Remove the duplication of your Python environments. If you need more than one environment, use one of the available Python virtual environment solution (conda, virtualenv etc)
Yam Mesicka
  • 6,243
  • 7
  • 45
  • 64
  • When I try to use the where python or where pip command, it returns this : INFO: Could not find files for the given pattern(s). – Louis Gaumond Oct 06 '17 at 18:58