New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Building error with macOS Big Sur (11.0.1) #2346
Comments
This looks like it didn't download the wheel for pygame 2.0.0 from pip so it tries to build from source. I assume the source build didn't work because some/all of the dependencies were missing. I wonder if the command:
doesn't work and you actually just need:
? |
Yeah actually with Big Sur, Apple has moved some dependencies on other locations so yeah building from source doesn't work. I tried both with pip3 and pip3.9 |
looks like this is a bug with pip and mac wheels, see: numpy/numpy#17784 and pypa/packaging#319 pip looks for a Link: then rename to:
and try and manually install the wheel with:
from the directory with the wheel file in it. See if that works. |
Thank you it worked as expected ! |
This workaround doesn't work for M1 macs. |
It sounds like this bug was fixed in the latest version of pip so I would make sure you update the version of pip you are using to 20.3.3. |
Cool! Good to know. Let's close this now then. (feel free to comment here if the new pip is still not working, and we can open it again) |
I installed the latest version of pip and I'm still unable to install
pygame.
Specs:
Apple M1 MBP
Big Sur 11.0.1
Sincerely,
Brittany Price
…On Sat, Jan 2, 2021 at 1:07 PM René Dudfield ***@***.***> wrote:
Cool! Good to know. Let's close this now then.
(feel free to comment here if the new pip is still not working, and we can
open it again)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2346 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALNNZECDM22YF3SH7M5HWDLSX5OFPANCNFSM4T35LFEA>
.
|
I am reoppening this because it dosen't seem to be 100% fixed yet... @brittlizprice You say the fix dosen't work on M1 macs. Is it still not installing the wheel and trying to compile (and failing)? |
Also can't install on MacBook Pro M1 with Python 3.9.1
|
Mac mini M1 also I can't install pygame:
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. |
@Ropuh @Endogen @brittlizprice so do any of you actually have SDL2 installed? I assume you do not, and the problem is just that there are no pre-built binary wheels for macos 11 on ARM. In the worst case, you have to compile SDL2 from source. Maybe we could draft one of you into installing SDL2 and building a wheel from source... |
I have downloaded the latest version of sdl (2.0.14) using the command : |
First make sure pip is on the latest version. |
@rajatyagi I would try to find where sdl2-config is installed on your system and add that to $PATH, and barring that, find out where brew installed the SDL2 libraries and header files and report back here. Based on what I know about homebrew (and I want to make it clear, I do not have an M1 mac or access to privileged information, all this is based on 5 minutes of googling), sdl2-config might be installed into /opt/homebrew/bin, but sdl2 can be installed on arm64 mac os with homebrew: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/sdl2.rb So what you probably need to do is:
I wouldn't want to hardcode /opt/homebrew/bin inside setup.py case python is installed in /Library/Frameworks or /usr/local or /opt/ports |
does installing SDL2 in /Library/Frameworks even install the sdl2-config command line program? |
The issue is resolved. |
@rajatyagi It should be the directory, not the program itself. Are you telling me In any case, if you get it to install with pip on one mac, you can run this: git clone https://github.com/pygame/pygame.git
cd pygame
python3.9 setup.py -config -auto -sdl2
python3.9 setup.py bdist_wheel to get a .whl file in the Before more people post about their homebrew setup: This is not a homebrew/macports/autoconf support forum. As far as I can tell, the arm64 mac os currently has no binary wheel support, but that is a different issue from this one that was posted about x86. We will may to open another issue for automatically binary wheels on mac os 11 with arm64 (Can we cross-compile? Does the CI run mac os?), but it seems to me that there is no problem actually compiling pygame if you have set up your system right. |
@brittlizprice In order to compile pygame, you need to install sdl2. You do not need to "reinstall pip" (I am probably misreading this. You can just use pip to upgrade pip. I do not think you need to uninstall and reinstall pygame via pip either). Right now, there are no binary pip wheels for pygame in arm64 mac os 11, so you have to compile your own sdl2 in order to compile pygame. Since there are no binary wheels for pygame yet, pip is attempting to compile pygame, but doesn't find the development files for SDL2. You can either download the source from libSDL2.org, or install via homebrew. Macports and fink might also work, I don't know. I haven't used a mac in a decade. Compilation and installation of SDL2 development files needs to be done before you run In any case, the original bug reported here has been resolved. This is not a mac OS help forum, but a bug tracker. I have created an issue with a task list for the mac os build situation. |
@robertpfeiffer I know it's not a macOS help forum, I wasn't entirely sure about how the
solution worked. I don't use terminal commands often. You don't have to be a jerk about it because you didn't get a DTK in June and make the transition earlier. Looking below clearly the issue isn't resolved. Users shouldn't have to go through this much trouble to use a plugin. For now I'll use something else.
…On Sun, Jan 17, 2021, 11:29 AM robertpfeiffer ***@***.***> wrote:
@brittlizprice <https://github.com/brittlizprice> In order to compile
pygame, you need to install sdl2. You do not need to "reinstall pip" (I am
probably misreading this. You can just use pip to upgrade pip. I do not
think you need to uninstall and reinstall pygame via pip either). Right
now, there are no binary pip wheels for pygame in arm64 mac os 11, so you
have to compile your own sdl2 in order to compile pygame. Since there are
no binary wheels for pygame yet, pip is attempting to compile pygame, but
doesn't find the development files for SDL2.
You can either download the source from libSDL2.org, or install via
homebrew. Macports and fink might also work, I don't know. I haven't used a
mac in a decade. Compilation and installation of SDL2 development files
needs to be done before you run pip install pygame.
In any case, the original bug reported here has been resolved. This is not
a mac OS help forum, but a bug tracker.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2346 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALNNZEBNBBLCFBZ3SP6NZSDS2MF65ANCNFSM4T35LFEA>
.
|
Works on my machine as well (MacBook Pro M1). Adding sdl2 to the path was not required in my case, it worked out of the box after using brew to install sdl2. However I still got an error installing pygame which was fixed by |
Running |
Hello everybody, despite all of your help I couldn't install pygame. Maybe the reason is that my version of python is from mini forge and miniconda ? I don't know really since it usually doesn't cause problems. I can add that the sdl2-config file was not un /usr/local/bin but in something like /opt/homebrew/Cellar/.. |
Same error, I am Mac M1, i do |
Thanks. This worked on macbook air m1 |
Here is my solution on Apple Silicon MacBook: |
@Raumss big big thanks! worked for me!!! |
It worked for me. Thanks! |
Worked for me too on M1 Macbook Pro! Thanks so much. |
Thank you!! |
export PATH=$PATH:/usr/local/bin/sdl2-config I only used these two commands |
This helped me solve the same IndexError... compiling issue, on Cygwin for Win10. |
Worked for me too on M1 Macbook Pro! Thanks so much. |
Environment:
OS : macOS Big Sur 11.0.1 Build (20B29)
Pygame : 2.0.0
Python : 3.9, tried also with 3.8
Current behavior:
Build error when installing from pip3
Steps to reproduce:
Stack trace/error output/other error logs
Does someone else have this problem ?
I've tried installing SDL2 with homebrew, and I got another error but It still don't want to build it. So yeah there is bug when building it.
The text was updated successfully, but these errors were encountered: