18

Trying to install Django from cmd with pip.

Python 2.7.3, Windows 7

Env var(...C:\Python27;C:\Python27\Lib\site-packages\;C:\Python27\Scripts\;)

    help("pip")
    .
    .
    .
    .
    VERSION
        1.3.1

    pip install Django
    File "<stdin>", line 1
    pip install Django
          ^
    SyntaxError: invalid syntax
BoJack Horseman
  • 4,406
  • 13
  • 38
  • 70
That_User
  • 929
  • 2
  • 7
  • 25

6 Answers6

35

Run pip install django from windows command prompt instead of python shell.

arulmr
  • 8,620
  • 9
  • 54
  • 69
9

under the folder C:\Python27\Scripts (or the folder you installed pip), press SHIFT and right click a blank space then select open command window here, run

pip install Django
zheek
  • 742
  • 1
  • 11
  • 22
Fei Zheng
  • 141
  • 1
  • 4
  • Perfect Works great for Windows. –  Nov 18 '14 at 18:20
  • I had python 3.3 so, go to `C:\Python33\Scripts` using command prompt and run `pip3.3.exe install django` –  Nov 18 '14 at 18:23
6
pip install django==1.4

or

pip install django==1.6

or

pip install  django
arulmr
  • 8,620
  • 9
  • 54
  • 69
johnyOne
  • 61
  • 1
  • 1
3

pip is not run from the Python shell. Run this from the Command prompt.

pip install Django

It will install the latest Django 1.5.

pynovice
  • 7,424
  • 25
  • 69
  • 109
2

In addition to user2032220's answer and arulmr's answer, try to install Django within a Virtual Environment.It will help you in the long run.

Here's the way to do it :

http://simononsoftware.com/virtualenv-tutorial/

Aryak Sengupta
  • 1,727
  • 2
  • 18
  • 23
0

Running Python34 you should go to c:Python34, folder Scripts, and type

  pip install django.                                    
zheek
  • 742
  • 1
  • 11
  • 22