10

I am trying to install some modules using pip. My system is Windows 7 64-bit, and I'm using Python Shell and Python 2.7.

I've typed in following code to start the installation:

python -m pip install traitlets

According to this page, the above code should work. However I've got pip highlighted in red and an error message:

SyntaxError: invalid syntax

Can someone please point out what is wrong with my code?

ChangeMyName
  • 7,018
  • 14
  • 56
  • 93

2 Answers2

11

You have to execute that command in a windows command prompt, not in a python shell.

Stop harming Monica
  • 12,141
  • 1
  • 36
  • 56
10

How do I install pip on Windows?

This installed Pip at C:\Python27\Scripts\pip.exe. Find pip.exe on your computer, then add its folder (for example, C:\Python27\Scripts) to your path (Start / Edit environment variables). Now you should be able to run pip from the command line. Try installing a package:

pip install httpie

Community
  • 1
  • 1
JRazor
  • 2,707
  • 18
  • 27