I'm trying to install Pygame. I am running Windows 7 with Enthought Python Distribution. I successfully installed pip
, but when I try to install Pygame using pip
, I get the following error:
"Could not install requirement Pygame because of HTTP error HTTP error 400: Bad request for URL ..."
I can't find anything about this issue with a Google search, but I did find another Stack Overflow question that prompted the asker to use the following command:
pip install hg+http://bitbucket.org/pygame/pygame
This gave me the following error:
Cannot find command hg
I'm not sure what else to do, as everything I find with a Google search is for Mac, so I don't know how well I can follow those instructions on Windows.
Try
This worked twice for me on windows 7 and windows 10
Try doing this:
An update to this may be required, as it stands in version 1.9.1 it should simply install using:
pip install pygame
However, it look like there is a bug with their pypi repository, see: https://bitbucket.org/pygame/pygame/issues/59/pygame-has-no-pypi-page-and-cant-be
So, if you want the most recent release, you have to point directly at the ftp file ala:
pip install http://www.pygame.org/ftp/pygame-1.9.1release.tar.gz
I suppose this will be fixed in the 1.9.2 release but for now this works.
I would note that the answer supplied by Pratyush works as well, but requires the user to install mercurial if they don't have it and downloads the trunk version, so really, not ideal unless you absolutely need it.
I think if you go to Command Prompt and type
that's what works for me
Try:
python -m pip install pygame
Or:
py -m pip install pygame
I have never used Enthought distribution, but you could try to use Anaconda distribution which is also great too.
Anaconda Distribution (Any OS):
From the docs:
Install on Windows (both python 2.7 and 3.7):
Install on raspberry pi: