0

I'm trying to import pyaudio i installed portaudio with the command brew install portaudio and i installed pyaudio with pip now Im trying to import pyaudio and python shows me the error

Could not import the PyAudio C module '_portaudio'

now when i try to follow the instructions of the answer of pyaudio could not import _portaudio

the portaudio tar doesn't have the install file

PORTAUDIO TAR CONTENENTS

What can i do?

Python: 3.4

Operating system: Mac OSX the captain

lit
  • 14,456
  • 10
  • 65
  • 119
Ger
  • 238
  • 4
  • 15
  • 3
    Possible duplicate of [pyaudio could not import \_portaudio](https://stackoverflow.com/questions/36681836/pyaudio-could-not-import-portaudio) –  May 08 '18 at 23:47

2 Answers2

5

If you are on Anaconda, try the following command. It worked for me:

conda install -c anaconda portaudio
double-beep
  • 5,031
  • 17
  • 33
  • 41
Manas
  • 59
  • 1
  • 6
0

Follow Step 3 in the link (pyaudio could not import _portaudio):

Open Terminal in the directory. Run the following command line one by one.

./configure

make

make install # you may need to be root link

Then, portaudio will be installed. After this, please follow next steps in the link: Get the dependencies for pyaudio. Uninstall pyaudio and reinstall pyaudio.

YoungChoi
  • 324
  • 4
  • 14
  • when i reinstall pyaudio shell shows me the error fatal error: 'pa_mac_core.h' file not found – Ger May 09 '18 at 03:06
  • @ger Please check the link below: https://stackoverflow.com/questions/14512741/pyaudio-portaudio-and-mac-10-7-5 – YoungChoi May 09 '18 at 03:12
  • @ger Can you do make install with sudo? I found you may need to be root to install correctly: [link](https://people.csail.mit.edu/hubert/pyaudio/compilation.html) – YoungChoi May 09 '18 at 03:24
  • 'pa_mac_core.h' file not found – Ger May 09 '18 at 03:41
  • @ger Did you try one of the solutions from the link in my comment? It seems possible duplicate of [error: pa_mac_core.h: No such file or directory](https://stackoverflow.com/q/14512741/9711275). – YoungChoi May 09 '18 at 04:10
  • i try all the solution and nothing works error: command '/usr/bin/clang' fatal error: 'pa_mac_core.h' – Ger May 09 '18 at 13:52