As the title suggests I am having trouble installing pygame on my Mac. I've tried a lot different solutions. Such as using the steps in Python Crash Course to looking on stack overflow.
I've tried:
and I receive error in pip no matter which technique I use.
In the IDE i'm using which is spyder I get this error:
ModuleNotFoundError: No module named 'pygame'Any help would be massively appreciated!
Thank you in advance :)
1 Answer
You see the error
ModuleNotFoundError: No module named 'pygame'because the Python version you are running in your IDE cannot detect te pygame module you installed.
Homebrew Python
A clean way to install and use Python packages on MacOS is to
- Install Homebrew -
Install Python using Homebrew
brew install pythonIn your IDE, set Python's Site-Packages with the
PYTHONPATHenvironment variable, for example for Python 3.7.x, set it to/usr/local/lib/python3.7/site-packages