1

But it is installed, coz when I run

python -m django --version

it shows

1.10.1.

But when I try to start some project django-admin startproject mysite or check the version with django-admin --version , it shows

The program 'django-admin' is currently not installed. You can install it by typing: sudo apt-get install python-django` 

I'm using ubuntu 14.04. I'm new to django, I was just trying to follow some tutorial to learn it and faced this issue.

6
  • 1
    1) how did you install django? and 2) care to link the tutorial you were following? Commented Sep 23, 2016 at 1:58
  • I was just started with the django official tutorial and it asked me to check if django is installed. I tried the check and it was installed, actually forgot how I installed it. :( Commented Sep 23, 2016 at 2:04
  • 1
    Running python -c 'import django; print(django.__file__)' will tell you where your django is installed, which would be a good start to understanding your issue. Commented Sep 23, 2016 at 2:08
  • python -c 'import django; print(django.__file__)' shows /home/rafaftahsin/.local/lib/python2.7/site-packages/django/__init__.pyc @spectras Commented Sep 23, 2016 at 2:10
  • 1
    So you have some local install in your home directory. If it's not intentional, you should probably get rid of it altogether and either install it with apt-get or, better yet, create a virtualenv for your project. See also this question where someone had basically the same problem with numpy. Just replace "numpy" with "django" in that answer. Commented Sep 23, 2016 at 2:14

2 Answers 2

6

Reinstall django:

sudo apt-get purge python-django sudo pip uninstall django sudo apt-get install python-django sudo pip install django --upgrade 

Also you can use virtualenv and virtualenvwrapper to have a better package isolation for multiple projects.

Sign up to request clarification or add additional context in comments.

3 Comments

so far discussed in the comment, django is installed in local. so neither sudo apt-get purge python-django nor sudo pip uninstall django will uninstall it. will it ???
There are two ways to install django as far as I know, so one of these methods should work!
@200OK> they won't indeed. A simple rm -rf /home/rafaftahsin/.local/lib/python2.7/site-packages/django will however.
1

Run this command: sudo easy_install django
It will create a file named django-admin at /usr/local/bin
Then, you can run the following command successfully: django-admin startproject mysite

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.