我想在 python 上安裝 pygame。我有 ubuntu 20.04(已經(jīng)安裝了 python3.8)和 Anaconda。pip 已連接到 Anaconda:which pip顯示它位于/home/mohammad/anaconda3/bin/pip.我使用pip在Anaconda上安裝pygame。但是顯示錯誤。如何在 Anaconda 上安裝 pygame?pip install pygame我可以通過停用 Anaconda 環(huán)境并使用將其安裝在系統(tǒng) python 上的 pip 來簡單地安裝 pygame(它應該沒有任何問題)。但我想在 Anaconda 上安裝 pygame。我真的不知道問題出在哪里。$ pip install pygameCollecting pygame Using cached pygame-1.9.6.tar.gz (3.2 MB) ERROR: Command errored out with exit status 1: command: /home/mohammad/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-z7x7jtmx/pygame/setup.py'"'"'; __file__='"'"'/tmp/pip-install-z7x7jtmx/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-ctnap_n6 cwd: /tmp/pip-install-z7x7jtmx/pygame/ Complete output (25 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
在 Anaconda 上安裝 Pygame 的問題
慕田峪9158850
2023-05-23 14:44:16