Home python Can't install PyGame in PyCharm

Can’t install PyGame in PyCharm

Author

Date

Category

In the Terminal tab in PyCharm I typed

pip3.8 install pygame
pip3 install pygame
pip install pygame

And I always got this error:

ERROR: Command errored out with exit status 1:
   command: / sysroot / home / user / PycharmProject / ??? / venv / bin / python -c 'import sys, setuptools, tokenize; sys.argv [0] = '"'" '/tmp/pip-install-ltp9j88k/pygame/setup.py' "'"'; __file __ = '"'" '/ tmp / pip-install-ltp9j88k / 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-un0ew218
     cwd: / tmp / pip-install-ltp9j88k / pygame /
  Complete output (12 lines):
  WARNING, No "Setup" File Exists, Running "buildconfig / config.py"
  Using UNIX configuration ...
  / bin / sh: sdl-config: command not found
  / bin / sh: sdl-config: command not found
  / bin / sh: sdl-config: command not found
  Hunting dependencies ...
  WARNING: "sdl-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.

In a regular Linux terminal, I managed to install pygame via pip
If this problem cannot be solved, then write a Python module to handle keyboard events that you know


Answer 1, authority 100%

In PyCharm Pro 2020.2.2, you can install PyGame like this:

  • File
  • Settings
  • Project
  • Python Interpreter
  • [+]
  • pygame
  • Install Package

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions