Eduardo Quirino
Eduardo Quirino

Reputation: 13

Can't Install Django

I can't install Django, I read that pip is included in python 3.4, but when I write following command:

pip install django

this error appears:

SyntaxError: invalid syntax.

What I should do? Am I missing something? I'm using Python 3.4.2

Upvotes: 1

Views: 3642

Answers (3)

Holloway
Holloway

Reputation: 7377

From the SyntaxError: invalid syntax it looks like you're typing it in at the python interpreter (the >>>). pip install django needs to be run from a terminal.

pip is installed when you install python but it is a program in its own right not a python package/module. Docs are here

Upvotes: 4

RustyShackleford
RustyShackleford

Reputation: 27388

I recommend using virtualenv for you django project, which includes pip. You can install virtualenv by:

$ curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-X.X.tar.gz
$ tar xvfz virtualenv-X.X.tar.gz
$ cd virtualenv-X.X
$ [sudo] python setup.py install

Then cd to a folder you want to create a django project:

$ virtualenv ENV

then simply run

$ source bin/activate

You should be able to pip install django from there

Upvotes: 1

felipsmartins
felipsmartins

Reputation: 13559

Since Python 3.4, pip installer is included by default with the Python binary installers.

~$ python -m pip install django

Read the docs:

or (on Debian/Ubuntu)

~$ apt-get install python3-pip

Upvotes: 1

Related Questions