-1

Every time I want to use python on cmd on Windows 10, I get this error.

Python 3.6.3 (v3.6.3:2c5fed8, Oct  3 2017, 17:26:49) [MSC v.1900 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> pip install pygame
  File "<stdin>", line 1
    pip install pygame
          ^
SyntaxError: invalid syntax

How is this wrong? Every other command leads to a error like this.

martineau
  • 119,623
  • 25
  • 170
  • 301
  • That's not Windows `cmd`'s prompt, it's the Python console's. Run `pip` from the former and you should have better luck. – martineau Nov 05 '17 at 21:47

2 Answers2

2

pip is a command to use at the Windows Command Line prompt (the C:\ prompt), not for use in the python shell.

(So don't start Python first. Just open a command prompt and type "pip install pygame" at the C: prompt.)

sql_knievel
  • 1,199
  • 1
  • 13
  • 26
1

If you dont have acces to the terminal you could use something like this to use pip within a script :

https://stackoverflow.com/a/15950647/8577333

An0n
  • 705
  • 6
  • 19