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.VERSIONI face no issues and get
(1, 8, 2, 'final', 0) Then, to start my project, I typed
django-admin startproject trialsiteand I got a message saying
Cannot find installed version of python-django or python3-djangoI 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
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-djangoYou can test that the installation was successful by typing:
django-admin --versionGlobal Install through pip:
sudo apt-get updateNow you can install pip. If you plan on using Python version 2, install using the following commands:
sudo apt-get install python-pipIf, instead, you plan on using Python 3, use this command:
sudo apt-get install python3-pipNow that you have pip, we can easily install Django. If you are using Python 2, you can type:
sudo pip install djangoIf you are using Python 3, use the pip3 command instead:
sudo pip3 install djangoYou can verify that the installation was successful by typing:
django-admin --versionGlobal Install through pip.
- Global Install through pip.
full Details and all rights goes to the owner from digitalOcean
3