Start with modifying the PATH line in. your Zsh shell dot file (~/.zshrc):
export PATH="/usr/local/bin:${PATH}
and then from the Terminal, run the following to make that PATH current:
source ~/.zshrc
Next, you install Python 3.9.4 (universal) directly from Python.org (not using brew) — which is a normal macOS package installer. It will create a Python 3.9 folder in your /Applications folder, deposit python3, idle3, etc in /usr/local/bin as links back to:
/Library/Frameworks/Python.framework/Versions/3.9/bin
and though the Python 3.9.4 installer updates your PATH statement for Bash, it still does not do so for the Zsh shell, so back to your ~/.zshrc dot file for one last change:
export PATH="/Library/Frameworks/Python.framework/Versions/3.9/bin:${PATH}"
and
source ~/.zshrc
If you have installed Xcode, or the command-line tools for Xcode 12.4, these place a Python v3.8.2 into /usr/bin, and if you do not make the preceding PATH adjustments, it is that older Python3 that you get by default, and one that won't let you install modules into it.
The last
PyAudio
module that I see was last updated in 2017 and very likely not compatible with Python 3.9.4.
One way to avoid polluting the main Python 3.9.4 package area is to create a
virtual environment
that you install packages into as I have done for pyobjc, pyobjc-core, and Qt 5.15.
Hello @jitender8076,
I solved this issue on my M1 Mac through the following Steps:
-
Firstly, uninstall the PyAudio & portaudio from you systemby the following commands:
brew uninstall portaudio
pip uninstall pyaudio
brew update
-
Upgrade the wheel and setuptools:
python3 -m pip install --upgrade pip setuptools wheel
-
Then, install the latest version of portaudio:
brew install portaudio --HEAD
python3 -m pip install pyaudio --global-option="build_ext" --global-option="-I/opt/homebrew/include" --global-option="-L/opt/homebrew/lib"
For Miniforge/ Anaconda environment, install the pyaudio in side the environment i.e:
conda activate myEnvName
python3 -m pip install pyaudio --global-option="build_ext" --global-option="-I/opt/homebrew/include" --global-option="-L/opt/homebrew/lib"
And you are good to go!!!
Start with modifying the PATH line in. your Zsh shell dot file (~/.zshrc):
export PATH="/usr/local/bin:${PATH}
and then from the Terminal, run the following to make that PATH current:
source ~/.zshrc
Next, you install Python 3.9.4 (universal) directly from Python.org (not using brew) — which is a normal macOS package installer. It will create a Python 3.9 folder in your /Applications folder, deposit python3, idle3, etc in /usr/local/bin as links back to:
/Library/Frameworks/Python.framework/Versions/3.9/bin
and though the Python 3.9.4 installer updates your PATH statement for Bash, it still does not do so for the Zsh shell, so back to your ~/.zshrc dot file for one last change:
export PATH="/Library/Frameworks/Python.framework/Versions/3.9/bin:${PATH}"
and
source ~/.zshrc
If you have installed Xcode, or the command-line tools for Xcode 12.4, these place a Python v3.8.2 into /usr/bin, and if you do not make the preceding PATH adjustments, it is that older Python3 that you get by default, and one that won't let you install modules into it.
The last
PyAudio
module that I see was last updated in 2017 and very likely not compatible with Python 3.9.4.
One way to avoid polluting the main Python 3.9.4 package area is to create a
virtual environment
that you install packages into as I have done for pyobjc, pyobjc-core, and Qt 5.15.
KunalBhayana wrote:
Even I am a longtime Windows user I am regretting this purchase so much.
The whole problem here is that these are unsupported, open-source projects that you can't purchase for any price. The idea is that you purchase an M1 Mac so that you can fix pyaudio, homebrew, pip3, pipwin, portaudio, and Python 3 so that they will work on the M1 for other people. Large corporations like Google, Amazon, and Facebook would really appreciate your work so that they can more easily port their internal code to less expensive ARM-based system. You weren't expecting them to do the work themselves, were you?
KunalBhayana wrote:
I was expecting everything to be ready since it's almost 6 months now.
Actually it has been almost 11 months since Apple Silicon computers have first been available to developers. Apple is only responsible for its own software, which works fine. If you have 3rd party software that isn't working, you will have to contact the developers and let them know.
Hello @jitender8076,
I solved this issue on my M1 Mac through the following Steps:
-
Firstly, uninstall the PyAudio & portaudio from you systemby the following commands:
brew uninstall portaudio
pip uninstall pyaudio
brew update
-
Upgrade the wheel and setuptools:
python3 -m pip install --upgrade pip setuptools wheel
-
Then, install the latest version of portaudio:
brew install portaudio --HEAD
python3 -m pip install pyaudio --global-option="build_ext" --global-option="-I/opt/homebrew/include" --global-option="-L/opt/homebrew/lib"
For Miniforge/ Anaconda environment, install the pyaudio in side the environment i.e:
conda activate myEnvName
python3 -m pip install pyaudio --global-option="build_ext" --global-option="-I/opt/homebrew/include" --global-option="-L/opt/homebrew/lib"
And you are good to go!!!
First comment 'brew install portaudio' in a virtual environment then 'pip install pyaudio' or 'pip3 install pyaudio' if these comments don't work try this comment in a virtual enviorenment if you directly paste the comment in terminal maybe doesn`t run 'pip install --global-option='build_ext' --global-option='-I/opt/homebrew/Cellar/portaudio/19.7.0/include' --global-option='-L/opt/homebrew/Cellar/portaudio/19.7.0/lib' pyaudio'
A forum where Apple customers help each other with their products. Get started with your Apple ID.
Learn more
Sign up
This site contains user submitted content, comments and opinions and is for informational purposes
only. Apple may provide or recommend responses as a possible solution based on the information
provided; every potential issue may involve several factors not detailed in the conversations
captured in an electronic forum and Apple can therefore provide no guarantee as to the efficacy of
any proposed solutions on the community forums. Apple disclaims any and all liability for the acts,
omissions and conduct of any third parties in connection with or related to your use of the site.
All postings and use of the content on this site are subject to the
Apple Support Community Terms of Use.
See how your data is managed...