Получен код ошибки 1 при попытке установить PyGame на MacOS 10.7.5.
Обновлены setuptools, pip до последней версии. То же самое.
Запуск питона 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/```
Я новичок в программировании и Python, поэтому я действительно не знаю, что я делаю как таковой. Кроме того, исходное сообщение об ошибке было длиннее, но мне пришлось сократить его, чтобы опубликовать, так что могут быть пропущены важные вещи. Я оставил во всех сообщениях об ошибках.
РЕДАКТИРОВАТЬ: я попробовал 'pip install pygame == 1.9.2' и получил
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/
Кто-то еще дал ответ о зависимостях, и я подумал, что это может помочь, учитывая приведенный выше код ошибки, поэтому я попытался «brew install sdl sdl_image sdl_mixer sdl_ttf portmidi» и получил:
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
Я не уверен, что делать, потому что кажется, что везде есть ошибки.
Я понимаю, что решить мою проблему может быть очень просто, но я не знаю, с чего начать Спасибо, что прочитали это, надеюсь, вы сможете мне помочь.