I have installed latest django(2.2) using pip3 command. Although it is successfully installed I getting below error for the command-
django-admin --version
Error: Cannot find installed version of python-django or python3-django.
Same error I am getting while going to create a project using start project.I have also tried to solve this problem after seeing some similar question in this platform by installing django with apt-get command, but it installs django 1.1 not 2.2.
1 Answer
One reason you cannot find the Django is because you installed it in one virtual environment and now looking for it in another place.So suppose you are in the directory Codes. $ cd Codes
Then first you create a virtual environment:
$ virtualenv envThen you activate the virtual environment:
$ source env/bin/activateOnce activated, your terminal will look like this: (env) $Now install django inside env:
(env) $ pip install djangoSO you have Django INSIDE THIS env, each time you want django, you need to activate this env. So suppose, you close this terminal and open a new terminal:
Then you 1st activate the environment:
$ cd Codes
$ source env/bin/activate # <--- do this whenever you need django
(env)$ django-admin --version
2.2.7 # <--- django versionI hope this works.
1