2

I tried installing pygame using

pip install pygame

I tried installing it using Python 3.8 but it outputs the error below.
I also tried installing using Python 3.7 but still no luck.

The error:

ERROR: Command errored out with exit status 1:
     command: 'c:\users\asus\appdata\local\programs\python\python38-32\python.exe'
-c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Asus\\AppData\\Local\\Temp\\pip-install-_ptqagog\\pygame\\setup.py'"'"';
__file__='"'"'C:\\Users\\Asus\\AppData\\Local\\Temp\\pip-install-_ptqagog\\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 'C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\pip-egg-info'
         cwd: C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\
    Complete output (17 lines):


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


    Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x86"? [Y/n]Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\setup.py", line 194, in <module>
        buildconfig.config.main(AUTO_CONFIG)
      File "C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\buildconfig\config.py", line 210, in main
        deps = CFG.main(**kwds)
      File "C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\buildconfig\config_win.py", line 576, in main
        and download_win_prebuilt.ask(**download_kwargs):
      File "C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\buildconfig\download_win_prebuilt.py", line 302, in ask
        reply = raw_input(
    EOFError: EOF when reading a line
    ---------------------------------------- 
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
4

5 Answers 5

9

Use this (I was facing the same issue and it helped me out):

pip install pygame --pre
Sign up to request clarification or add additional context in comments.

Comments

2

You can try to install from the Wheel file.

After verifying that you're using python 3.7

python --version # Python 3.7.X
pip install pygame-1.9.6-cp37-cp37m-win_amd64.whl 

1 Comment

Thanks, after switching version to 3.7.4, it worked!
0

What kind of OS system are you using? I have no problem to install on python 3.7

(base) $ python3 -m pip install -U pygame --user
Collecting pygame
  Downloading https://files.pythonhosted.org/packages/32/37/453bbb62f90feff2a2b75fc739b674319f5f6a8789d5d21c6d2d7d42face/pygame-1.9.6-cp37-cp37m-macosx_10_11_intel.whl (4.9MB)
     |████████████████████████████████| 4.9MB 2.7MB/s 
Installing collected packages: pygame
Successfully installed pygame-1.9.6
(base) $ python -m pygame.examples.aliens
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html

If the problem persists, you should use conda or another environment manager to create new environment and then install the library.

1 Comment

I use Windows 10 Home SIngle Language
0

In macOS Ventura :

Check for your python, pip version and list of installed packages :

In Terminal :

Get version of python that is default

python -V

Get the version of pip that is default

pip -V

list installed packages

pip list

OUTPUT Sample for [ pip list]

Package    Version
---------- -------
pip        23.1.2
setuptools 60.2.0
wheel      0.37.1

Now install pygame

pip3 install pygame

Result :

Collecting pygame Downloading pygame-2.4.0-cp310-cp310-macosx_10_9_x86_64.whl (13.0 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.0/13.0 MB 5.3 MB/s eta 0:00:00

Installing collected packages: pygame Successfully installed pygame-2.4.0

Comments

-2

I'm not getting an error when I do this. Have you tried:

pip install pygame

Have you attempted installing with command-prompt or terminal? When I run what you are doing, I don't seem to get a problem.

Additionally, pygame is not compatible with 3.8 yet as it is unstable. Maybe wait a few months until modules are ready to be used with 3.8. Hope this helps, good day.

2 Comments

I did try installing by using that command on both version but no luck. Python 3.8 is not compatible, but my Python 3.7 also didn't work.
Thanks for contributing, but it's not helpful, since the first thing the original poster says is...I tried installing pygame using 'pip install pygame'

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.