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.

Rahul Satal
  • 357
  • 1
  • 4
  • 13
Kruti Joshi
  • 223
  • 1
  • 2
  • 7

1 Answers1

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

Maythux
  • 82,867
  • 54
  • 239
  • 271