I'm trying to install Pygame for python 3.5 32bit. I have learned that I can open the .whl files provided on the site by using the pip command. The problem is I've tried multiple ways doing this but with constant error.
python -m pip install pygame-1.9.2a0-cp35-none-win32.whl
'python' is not recognized as an internal or external command,
operable program or batch file.
The file I'm trying to install: pygame-1.9.2a0-cp35-none-win32.whl
My python program is located in my programs folder and everything else works fine.
解决方案
You need to add python.exe to your Windows PATH variable.
The is the system variable that the operating system uses to locate the needed executables from the command line or Terminal windows. [1]
Actually there are many methods to set the PATH variable on windows. One way is to type
set PATH=%PATH%;location path of Python.exe
into the windows command-line interpreter (cmd):
set PATH=%PATH%;C:\Python35-32
Now -- before running the pip command -- you need to make sure that either
your working directory is set to the same folder where your pygame-1. ... in32.whl file is located
or
you supply the full absolute or relative path to the pip command.
Now you should be able to run your python -m pip command after restarting the cmd.exe.