12

I'm new to Ubuntu, and I love it so far. I have been trying to install Django for a website development project. In the terminal, when I start the python interpreter and type

import django 
django.VERSION

I face no issues and get

(1, 8, 2, 'final', 0) 

Then, to start my project, I typed

django-admin startproject trialsite

and I got a message saying

Cannot find installed version of python-django or python3-django

I installed django using pip install Django==1.8.2 and also installed the django-admin package before using it via apt-get. Also, I have been following the Django book as a guide through the whole process. Can someone tell me what the issue is?


EDIT:
My /usr/local/lib/python2.7/dist-packages and site-packages are both empty. I don't know if this is important. But according to the django book, this is where django-admin should be.

1 Answer 1

16

There are a number of different ways in which you can install Django depending upon your needs and how you want to configure your development environment.

  • Global Install from Packages:

    sudo apt-get update
    sudo apt-get install python-django
    

    You can test that the installation was successful by typing:

    django-admin --version
    
  • Global Install through pip:

    sudo apt-get update
    

    Now you can install pip. If you plan on using Python version 2, install using the following commands:

    sudo apt-get install python-pip
    

    If, instead, you plan on using Python 3, use this command:

    sudo apt-get install python3-pip  
    

    Now that you have pip, we can easily install Django. If you are using Python 2, you can type:

    sudo pip install django
    

    If you are using Python 3, use the pip3 command instead:

    sudo pip3 install django
    

    You can verify that the installation was successful by typing:

    django-admin --version
    
  • Global Install through pip.

  • Global Install through pip.

full Details and all rights goes to the owner from digitalOcean

3
  • thank you. I am confused though. I used sudo apt-get install python-django, and it worked. But when I used pip install Django==1.8.2, even that installed django right? Commented Jul 2, 2015 at 5:37
  • It is the same. 1.8.2 Commented Jul 2, 2015 at 5:43
  • I suppose specifying version was the problem Commented Jul 2, 2015 at 5:46

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.