Kruti Joshi
Kruti Joshi

Reputation: 526

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

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?

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.

Upvotes: 4

Views: 7973

Answers (2)

VGR
VGR

Reputation: 1

If you are using tcsh as I was to run django-admin, my shell did not have the "$_" environment variable. After creating it as follows, I was able to get django-admin running.

% set _ = (/usr/bin/env) 

% django-admin --version
1.11.3

You can add $_ to your .tcshrc file so it loads in your profile automatically.

Upvotes: 0

Sumit Shrestha
Sumit Shrestha

Reputation: 396

Use following command and it will be solved.

sudo apt-get install python-django

Upvotes: 17

Related Questions