ОШИБКА: Команда завершилась с ошибкой, код выхода 1

ОШИБКА: Команда завершилась с ошибкой, код выхода 1

Попробовал установить pygame с помощьюpip3 установить pygameв Ubuntu 20.04 я вышел с ошибкой. Любая помощь приветствуется

Моя ошибка выглядит так

ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-9w9lq7il/pygame/setup.py'"'"'; file='"'"'/tmp/pip-install-9w9lq7il/pygame/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-9w9lq7il/pygame/pip-egg-info
         cwd: /tmp/pip-install-9w9lq7il/pygame/
    Complete output (29 lines):
    
    
    WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
    Using UNIX configuration...
    
    /bin/sh: 1: sdl-config: not found
    /bin/sh: 1: sdl-config: not found
    /bin/sh: 1: sdl-config: not found
    Package freetype2 was not found in the pkg-config search path.
    Perhaps you should add the directory containing `freetype2.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'freetype2' found
    Package freetype2 was not found in the pkg-config search path.
    Perhaps you should add the directory containing `freetype2.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'freetype2' found
    Package freetype2 was not found in the pkg-config search path.
    Perhaps you should add the directory containing `freetype2.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'freetype2' found
    /bin/sh: 1: freetype-config: not found
    /bin/sh: 1: freetype-config: not found
    /bin/sh: 1: freetype-config: not found
    
    Hunting dependencies...
    WARNING: "sdl-config" failed!
    WARNING: "pkg-config freetype2" failed!
    WARNING: "freetype-config" failed!
    Unable to run "sdl-config". Please make sure a development version of SDL is installed.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

решение1

sudo apt install libfreetype-dev libdsl2-dev

решение2

Пип жалуется конкретно:

/bin/sh: 1: sdl-config: not found

и

No package 'freetype2' found
/bin/sh: 1: freetype-config: not found

Итак, где они? Вы можете попробовать поискать в Google, но вы также можете установить apt-file(если он еще не установлен):

sudo apt install apt-file

и затем использовать это для поиска отсутствующих файлов. Например:

apt-file search "sdl-config"
apt-file search "freetype-config"

Вы обнаружите, что вам необходимо установить libfreetype-devи libdsl2-dev.

Связанный контент