18👍
pip search
command does not show installed packages, but search packages in pypi.
Use pip freeze
command and grep
to see installed packages:
pip freeze | grep Django
7👍
open the CMD and use this command :
**
pip uninstall django
**
it will easy uninstalled .
- [Django]-Do we need to upload virtual env on github too?
- [Django]-How to get an ImageField URL within a template?
- [Django]-How to pass multiple values for a single URL parameter?
6👍
Got it solved. I missed to delete the egg_info files of all previous Django versions. Removed them from /usr/local/lib/python2.7/dist-packages
. Also from /usr/lib/python2.7/dist-packages
(if any present here)
sudo pip freeze| grep Django
sudo pip show -f Django
sudo pip search Django | more +/^Django
All above commands should not show Django version to verify clean uninstallation
.
- [Django]-Specifying limit and offset in Django QuerySet wont work
- [Django]-Django: show the count of related objects in admin list_display
- [Django]-Difference between User.objects.create_user() vs User.objects.create() vs User().save() in django
5👍
Use Python shell to find out the path of Django:
>>> import django
>>> django
<module 'django' from '/usr/local/lib/python2.7/dist-packages/django/__init__.pyc'>
Then remove it manually:
sudo rm -rf /usr/local/lib/python2.7/dist-packages/django/
- [Django]-Annotate a queryset with the average date difference? (django)
- [Django]-How to pass django rest framework response to html?
- [Django]-Django – getting Error "Reverse for 'detail' with no arguments not found. 1 pattern(s) tried:" when using {% url "music:fav" %}
4👍
first use the command
pip uninstall django
then go to python/site-packages
and from there delete the folders for django and its site packages, then install django. This worked for me.
- [Django]-In django, how do I sort a model on a field and then get the last item?
- [Django]-Problems extend change_form.html in django admin
- [Django]-Django Rest Framework model serializer with out unique together validation
1👍
pip uninstall django
or
python -m pip uninstall django
will easily uninstall django
- [Django]-Django composite unique on multiple model fields
- [Django]-Django 1.7 – App 'your_app_name' does not have migrations
- [Django]-Django count RawQuerySet
0👍
Remove any old versions of Django
If you are upgrading your installation of Django from a previous version, you will need to uninstall the old Django version before installing the new version.
If you installed Django using pip or easy_install previously, installing with pip or easy_install again will automatically take care of the old version, so you don’t need to do it yourself.
If you previously installed Django using python setup.py install, uninstalling is as simple as deleting the django directory from your Python site-packages. To find the directory you need to remove, you can run the following at your shell prompt (not the interactive Python prompt):
$ python -c “import django; print(django.path)”
- [Django]-Specifying limit and offset in Django QuerySet wont work
- [Django]-How to run a celery worker with Django app scalable by AWS Elastic Beanstalk?
- [Django]-Django 1.3.1 compilemessages. Error: sh: msgfmt: command not found
0👍
I had to use pip3 instead of pip in order to get the right versions for the right version of python (python 3.4 instead of python 2.x)
Check what you got install at:
/usr/local/lib/python3.4/dist-packages
Also, when you run python, you might have to write python3.4 instead of python in order to use the right version of python.
- [Django]-Http POST drops port in URL
- [Django]-Django: show the count of related objects in admin list_display
- [Django]-Naming convention for Django URL, templates, models and views
0👍
On Windows, I had this issue with static files cropping up under pydev/eclipse with python 2.7, due to an instance of django (1.8.7) that had been installed under cygwin. This caused a conflict between windows style paths and cygwin style paths. So, unfindable static files despite all the above fixes. I removed the extra distribution (so that all packages were installed by pip under windows) and this fixed the issue.
- [Django]-Django Admin app or roll my own?
- [Django]-Altering one query parameter in a url (Django)
- [Django]-How do I remove Label text in Django generated form?
0👍
I used the same method mentioned by @S-T after the pip uninstall command. And even after that the I got the message that Django was already installed. So i deleted the ‘Django-1.7.6.egg-info’ folder from ‘/usr/lib/python2.7/dist-packages’ and then it worked for me.
- [Django]-Cannot access django app through ip address while accessing it through localhost
- [Django]-How to delete project in django
- [Django]-Django – No module named _sqlite3
0👍
The Issue is with pip –version or python –version.
try solving issue with pip2.7 uninstall Django
command
If you are not able to uninstall using the above command then for sure your pip2.7 version is not installed so you can follow the below steps:
1)which pip2.7
it should give you an output like this :
/usr/local/bin/pip2.7
2) If you have not got this output please install pip using following commands
$ wget https://bootstrap.pypa.io/get-pip.py
$ sudo python2.7 get-pip.py
3) Now check your pip version : which pip2.7
Now you will get
/usr/local/bin/pip2.7 as output
4) uninstall Django using pip2.7 uninstall Django
command.
Problem can also be related to Python version.
I had a similar problem, this is how I uninstalled Django.
Issue occurred because I had multiple python installed in my virtual environment.
$ ls
activate activate_this.py easy_install-3.4 pip2.7 python python3 wheel
activate.csh easy_install pip pip3 python2 python3.4
activate.fish easy_install-2.7 pip2 pip3.4 python2.7 python-config
Now when I tried to un-install using pip uninstall Django
Django got uninstalled from python 2.7 but not from python 3.4 so I followed the following steps to resolve the issue :
1)alias python=/usr/bin/python3
2) Now check your python version using python -V
command
3) If you have switched to your required python version now you can simply uninstall Django using pip3 uninstall Django
command
Hope this answer helps.
- [Django]-How do you detect a new instance of the model in Django's model.save()
- [Django]-Serializer call is showing an TypeError: Object of type 'ListSerializer' is not JSON serializable?
- [Django]-How to test Django's UpdateView?
-1👍
If installed Django using python setup.py install
python -c "import sys; sys.path = sys.path[1:]; import django; print(django.__path__)"
find the directory you need to remove, delete it
- [Django]-Django filter JSONField list of dicts
- [Django]-UUID as default value in Django model
- [Django]-Using the reserved word "class" as field name in Django and Django REST Framework