Python pip未安装Pygame,并给出错误消息

Python pip未安装Pygame,并给出错误消息,python,pygame,python-3.8,kali-linux,Python,Pygame,Python 3.8,Kali Linux,规范:kali与python 3.8.1 我开发了一个需要pygame的游戏。 所以像往常一样,我使用了“$pip install pygame”来下载和安装 它返回了一条错误消息 Collecting pygame Using cached pygame-1.9.6.tar.gz (3.2 MB) ERROR: Command errored out with exit status 1: command: /home/mohit/Projects/python/game

规范:kali与python 3.8.1

我开发了一个需要pygame的游戏。 所以像往常一样,我使用了“$pip install pygame”来下载和安装 它返回了一条错误消息

Collecting pygame
  Using cached pygame-1.9.6.tar.gz (3.2 MB)
    ERROR: Command errored out with exit status 1:
     command: /home/mohit/Projects/python/games/env/tetris_env/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-uorpw1u9/pygame/setup.py'"'"'; __file__='"'"'/tmp/pip-install-uorpw1u9/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-uorpw1u9/pygame/pip-egg-info
         cwd: /tmp/pip-install-uorpw1u9/pygame/
    Complete output (18 lines):


    WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
    Using UNIX configuration...


    Hunting dependencies...
    SDL     : found 1.2.15
    FONT    : not found
    IMAGE   : not found
    MIXER   : not found
    PNG     : found
    JPEG    : not found
    SCRAP   : found
    PORTMIDI: not found
    PORTTIME: not found
    FREETYPE: found 23.1.17
    Missing dependencies
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
'''
now I have some questions:
i) How can I install pygame using libsdl. 
ii) installing pySDL2 would using ```pip install pySDL2``` will help ? 
iii) if I want to install SDL from source then how can I ?
iv) is installing SDL to global and virtualenv are different ?

显然,您缺少一些系统依赖项。尝试安装:

sudo apt-get install libfreetype6-dev

显然,您缺少一些系统依赖项。尝试安装:

sudo apt-get install libfreetype6-dev

好的,您可以尝试使用软件包管理器
sudo-apt-get-install-python-pygame
全局安装它,或者尝试再次安装
sudo-apt-get-install-libsdl1.2-dev-fonts-freeffont-ttf-libsdl-image1.2-libsdl-mixer1.2-libsdl-ttf2.0-0
,然后再次尝试使用pip。实际上
apt-get-install-python-pygame
工作正常,但没有在python3.8版本中导入,所以在进行更多的谷歌搜索后,我发现安装是针对python2.x的,而对于py3,它只是
apt get install python3 pygame
,并且工作正常。谢谢好的,您可以尝试使用软件包管理器
sudo-apt-get-install-python-pygame
全局安装它,或者尝试再次安装
sudo-apt-get-install-libsdl1.2-dev-fonts-freeffont-ttf-libsdl-image1.2-libsdl-mixer1.2-libsdl-ttf2.0-0
,然后再次尝试使用pip。实际上
apt-get-install-python-pygame
工作正常,但没有在python3.8版本中导入,所以在进行更多的谷歌搜索后,我发现安装是针对python2.x的,而对于py3,它只是
apt get install python3 pygame
,并且工作正常。非常感谢。