一些前体信息:
操作系统:Ubuntu 20.04.1 LTS
Python版本: Python 3.8.5
IDE: PyCharm 2020.2.3(社区版)
我正在使用virtualenv。
问题:
我正在尝试使用official documentation和以下命令来安装pygame
python3 -m pip install -U pygame
(我尝试了不同的变体,例如,没有-U,带有--user等),我得到了错误:
ERROR: Command errored out with exit status 1:
command: /home/GBean/Dropbox/Projects/Python/Snake/venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-cghwhw8a/pygame/setup.py'"'"'; __file__='"'"'/tmp/pip-install-cghwhw8a/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-pip-egg-info-lo7hoty9
cwd: /tmp/pip-install-cghwhw8a/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.
我尝试过更新pip
和setuptools
,但运气不好,
例如https://github.com/facebook/prophet/issues/418
如果有人能指出正确的方向来解决这个问题,我将不胜感激。谢谢!