1

Got error code 1 while attempting to install PyGame on MacOS 10.7.5.

Upgraded setuptools, pip to latest version. Same thing. Running python 3.7.

Collecting pygame
  Using cached https://files.pythonhosted.org/packages/0f/9c/78626be04e193c0624842090fe5555b3805c050dfaa81c8094d6441db2be/pygame-1.9.6.tar.gz
Building wheels for collected packages: pygame
  Building wheel for pygame (setup.py) ... error
  ERROR: Complete output from command /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/s_/7t3xwh7j2cg3s0wtbp8mr7p40000gn/T/pip-install-le1w0xk3/pygame/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/s_/7t3xwh7j2cg3s0wtbp8mr7p40000gn/T/pip-wheel-ab9_asd7 --python-tag cp37:
  ERROR: running bdist_w
  running build_ext
  building 'pygame.gfxdraw' extension
  creating build/temp.macosx-10.6-intel-3.7
  creating build/temp.macosx-10.6-intel-3.7/src_c
  creating build/temp.macosx-10.6-intel-3.7/src_c/SDL_gfx
  src_c/_pygame.h:216:10: fatal error: 'SDL.h' file not found
  #include <SDL.h>
           ^
  1 error generated.

  error: command '/usr/bin/clang' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pygame
  Running setup.py clean for pygame
Failed to build pygame
Installing collected packages: pygame
  Running setup.py install for pygame ... error
    ERROR: Complete output from command /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/s_/7t3xwh7j2cg3s0wtbp8mr7p40000gn/T/pip-install-le1w0xk3/pygame/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/s_/7t3xwh7j2cg3s0wtbp8mr7p40000gn/T/pip-record-cwyl1pyo/install-record.txt --single-version-externally-managed --compile:
    ERROR: running install

ERROR: Command "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/s_/7t3xwh7j2cg3s0wtbp8mr7p40000gn/T/pip-install-le1w0xk3/pygame/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/s_/7t3xwh7j2cg3s0wtbp8mr7p40000gn/T/pip-record-cwyl1pyo/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/s_/7t3xwh7j2cg3s0wtbp8mr7p40000gn/T/pip-install-le1w0xk3/pygame/```

I'm new to programming and python, so I really don't know what I'm doing per se. Also, the original error message was longer, but I had to cut it down to post, so there might be important stuff missing. I left in all the error messages.

EDIT: I tried 'pip install pygame==1.9.2' and got

  Using cached https://files.pythonhosted.org/packages/da/b8/b110cdea95452f8f9f9e79d02062fdccaebfd808a667d6d9a805ca8d222a/pygame-1.9.2.tar.gz
    ERROR: Complete output from command python setup.py egg_info:
    ERROR: 

    WARNING, No "Setup" File Exists, Running "config.py"
    Using Darwin configuration...

    /bin/sh: sdl-config: command not found
    /bin/sh: sdl-config: command not found
    /bin/sh: sdl-config: command not found
    WARNING: "sdl-config" failed!
    Hunting dependencies...
    SDL     : not found
    Framework SDL not found
    FONT    : not found
    Framework SDL_ttf not found
    IMAGE   : not found
    Framework SDL_image not found
    MIXER   : not found
    Framework SDL_mixer not found
    Framework CoreMIDI found
    Framework QuickTime found
    PNG     : not found
    JPEG    : not found
    PORTMIDI: not found
    FREETYPE: found 2.4.7

    If you get compiler errors during install, doublecheck
    the compiler flags in the "Setup" file.


    Continuing With "setup.py"
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/s_/7t3xwh7j2cg3s0wtbp8mr7p40000gn/T/pip-install-ktiwxsb8/pygame/setup.py", line 294, in <module>
        write_version_module(METADATA['version'], revision)
      File "/private/var/folders/s_/7t3xwh7j2cg3s0wtbp8mr7p40000gn/T/pip-install-ktiwxsb8/pygame/setup.py", line 286, in write_version_module
        with open('version.py.in', 'r') as header_file:
    FileNotFoundError: [Errno 2] No such file or directory: 'version.py.in'
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/s_/7t3xwh7j2cg3s0wtbp8mr7p40000gn/T/pip-install-ktiwxsb8/pygame/

Someone else gave an answer about dependencies and I thought that might help given the error code above, so I tried 'brew install sdl sdl_image sdl_mixer sdl_ttf portmidi' and got:

fatal: HTTP request failed
Error: Failure while executing: git clone https://github.com/Homebrew/homebrew-core /usr/local/Library/Taps/homebrew/homebrew-core --config core.autocrlf=false --depth=1 -q
Error: Failure while executing: /usr/local/bin/brew tap homebrew/core -q

I'm not sure what to do, because it seems like there are errors everywhere. I realize it might be very simple to fix my problem, but I have no idea where to start. Thank you for reading this, I hope you can help me.

Archsys
  • 19
  • 2
  • https://stackoverflow.com/search?q=%5Bpygame%5D+fatal+error%3A+%27SDL.h%27+file+not+found – phd May 30 '19 at 21:37
  • I tried some answers on the two posts you linked but they didn't work. Thank you for helping me, do you know what I might be doing wrong? I edited the post. – Archsys May 31 '19 at 11:55
  • You'd better [brew install](https://stackoverflow.com/a/42285950/7976758) absent packages. – phd May 31 '19 at 13:27
  • @phd I had no success installing homebrew, it appears they don't support my version of macOS (10.7.5) anymore. Is there any way to resolve this? – Archsys Jun 12 '19 at 15:25
  • [10.12 or higher is recommended](https://docs.brew.sh/Installation#2). 10.9–10.11 are supported on a best-effort basis. For 10.4-10.6 see [Tigerbrew](https://github.com/mistydemeo/tigerbrew). – phd Jun 12 '19 at 15:54
  • 1
    Does this answer your question? [pygame installation issue in mac os](https://stackoverflow.com/questions/22974339/pygame-installation-issue-in-mac-os) – AMC Feb 09 '20 at 03:07

0 Answers0