Python Forum

Full Version: pip can't install pygame
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I went to the command prompt and typed py -m pip install -U pygame --user. It looked like it was working fine and then this popped up on the command prompt: Command "python setup.py egg_info" failed with error code 1 in C:\Users\Sheep\AppData\Local\Temp\pip-build-lxa1hxvd\pygame.
It's just pip install pygame
Run cmd as administrator.
This follow setup here Python 3.6/3.7 and pip installation under Windows
From start cmd with some explanation.
Microsoft Windows [Version 10.0.17134.407]
(c) 2018 Microsoft Corporation. Med enerett.

C:\WINDOWS\system32>cd\

# What python version used 
C:\>python -c "import sys; print(sys.executable)"
C:\python37\python.exe

# pip version "18.1" is the newest(python -m pip install --upgrade pip)
C:\>pip -V
pip 18.1 from c:\python37\lib\site-packages\pip (python 3.7)

# Install pygame
C:\>pip install pygame
Collecting pygame
  Using cached https://files.pythonhosted.org/packages/b0/30/.../pygame-1.9.4-cp37-cp37m-win32.whl
Installing collected packages: pygame
Successfully installed pygame-1.9.4

# Test that it work
C:\>python
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:05:16) [MSC v.1915 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygame
pygame 1.9.4
Hello from the pygame community. https://www.pygame.org/contribute.html
>>> pygame.__version__
'1.9.4'