0

I just tried to install pygame for python 3.4 my windows computer, but apparently I need to extract the whl file? I have seen other questions like this one on stackoverflow and it says to write in commant prompt:

pip install package-name.whl

However, when I tried this, I got in return:

'pip' is not recognized as an internal of external command, operable program, or batch file.

Is this because I have Windows 10? Please help!

The Entramanure
  • 19
  • 1
  • 1
  • 5
  • See: [How to install pip on Windows](https://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows). – Martin Aug 23 '15 at 11:36
  • nope works fine on windows 10 just make sure you put the whl file in the scripts folder with pip or give the path to it – john taylor Aug 23 '15 at 21:41
  • you need to add pip to the path variable to run it from default cmd. Just navigate to the python scripts folder and run it from there – DCA- Jun 08 '16 at 14:20

7 Answers7

2

For me this command works.->py -m pip install -U pygame --user But first, make sure you properly configure your environment variables. This tutorial http://www.aaronstannard.com/how-to-setup-a-proper-python-environment-on-windows/ will help you how to setup environment variables for python, make sure you do it correctly only step 2 ,no need to do any other steps from this tutorial, now you can follow my steps that were listed below. I will assume that you have already installed python in your computer

Step1

Search for cmd and Right click on cmd and do run as administrator.

Step2

Run the command, py -m pip install -U pygame --user, but before you run this command first of all make sure you configure your environment variables properly.

Step3

Type python in command prompt, this will take you to the python command line which will look like this ">>>".If not then you have a problem with your system variables.

Step4

Make sure you are in python command line and then type import pygame,and after this press ctrl+z and enter that will take you out from python command line.

Step5

Make sure you are not in python command line and then run this command py -m pygame.examples.aliens,if the game starts then congrats you are done.

Ishan Anand
  • 119
  • 1
  • 7
1

It can be possible that the pip/ wheel is not installed follow this link to install pip link

If already installed maked sure it is updated if not

You can use this code to update: python –m ensurepip –-upgrade or pip install --upgrade pip

To install wheel pip install wheel or upgrade pip install wheel --upgrade

once this is done you are good to install pygame

At the command line, make sure you’re in the same directory as the .whl file and run pip install package-name.whl

1

The issue is your pip isn't working correctly. To make sure it works, go to this folder C:\Python34\Scripts in windows explorer, hold shift and then right click. press 'open command prompt' here and then try to run pip.

R21
  • 396
  • 2
  • 12
0

That error occurs when the command entered, pip in this case, isn't found.

I just got pygame working on Windows 10 with these steps.

Download pygame-1.9.2a0-cp35-none-win32.whl from UCI.

Run the cmd shell and enter

> cd C:\Users\<me>\AppData\Local\Programs\Python\Python35-32\Scripts
> pip install C:\Users\<me>\Downloads\pygame-1.9.2a0-cp35-none-win32.whl

Start the Python 3.5 console. Therein enter

import pygame
dir(pygame)

No errors from either means that Pygame is ready for your command.

gherson
  • 169
  • 2
  • 9
0
pip install pygame

that's all you need, just remember to use it correctly in your code

csabinho
  • 1,579
  • 1
  • 18
  • 28
0

assuming that you have pip installed. You can run:

pip install pygame

in command prompt or a simulated terminal.

If you don't have pip already installed, please refer to this: (hope I helped!)

https://www.makeuseof.com/tag/install-pip-for-python/

Paul McBurney
  • 231
  • 3
  • 14
0

I updated my pip, then ran the command prompt (cmd) as adminstrator, then I issued a python command:

-m pip install pygame

And it installed pygame.

Carlos López Marí
  • 1,432
  • 3
  • 18
  • 45