As the Python Packaging Authority docs on Installing packages using pip explain, on Windows, you usually don't want to use pip
directly. It may not be on your PATH
, or it may be on your PATH
but not match the same version as the py.exe
launcher.
Usually, you want to use that py.exe
launcher for everything:
py -m pip install pygame
If you're not using py.exe
for some reason, the answer is usually one of these:
python -m pip install pygame
D:\path\to\specific\python -m pip install pygame
The official docs mention the python
version first, and only mention py
for when you're dealing with multiple Python versions. But you're probably better off always using py
, as the PyPA suggests. See PEP 397 for why the launcher is useful.)
Of course if you want to do this from inside IPython instead of directly at the shell, prefix any of those with !
.
As a side note: Notice that the same page pretty strongly recommends using virtualenv
(or the builtin venv
, but the documentation is all for virtualenv
). You should consider doing so, but if you have a good reason not to, it's not mandatory or anything.