Method 1:
If you plan to upgrade Django from a previous version, you need to delete the old version of Django before
Install the new version again.
If you are installing Django by executing the command ' setup.py install ', the uninstallation method is simple,
Just delete the ' Django ' directory in the ' site-packages ' directory.
If you use Python egg to install Django, delete the Django '. Egg ' file directly,
and delete the "easy-install.pth" in the egg reference can be.
This file should be found in the ' site-packages ' directory ...
Tip:: How do I find the ' site-packages ' directory?
The location of the ' site-packages ' directory depends on which operating system is used and where the Python is installed.
The following command can be used to display the ' site-packages ':
Python-c "from distutils.sysconfig import get_python_lib; Print Get_python_lib () "
(Note that the above command executes in the shell, not in Python.)
######################## Ubuntu under Uninstall Django ########################
In fact, just find the Django installation directory to delete it, under Ubuntu, Django here:
Cd/usr/local/lib/python2.7/dist-packages
Method 2:
Different projects may use different Django versions, and the concurrent sex is a big problem,
If unfortunately to take over different versions of the project, more tragic!
If you want to reload a Django version, you need to uninstall and install it first.
Find the Django installation path First
Python import sys; sys.path = sys.path[1:]; import Django; print (django.__path__)
Get the Django installation directory ['/library/python/2.7/site-packages/django ']
Delete the Django directory to
You can then reinstall
If you use Python egg to install Django, delete the Django '. Egg ' file directly,
- and delete the "easy-install.pth" in the egg reference can be.
-
- This file should be found in the ' site-packages ' directory ...
Method 3:
Previously installed on the machine is the Django0.96 version, recently wanted to remove the reinstallation of a 1.0 version.
1. First download the latest development version from SVN. The advantage of using the development version is that you can use the latest Django code
2. Remove older versions of previous installations
First, execute in the command line window:
Python code
- Python-c "from distutils.sysconfig import get_python_lib; Print get_python_lib () "
Look at where your site-packages directory is, and then delete the Site-packages/django folder.
3. Install the new version
To the downloaded Django directory, do the following:
Python code
- Python setup.py Install
Can.
4. View Django Version information
Command-line window:
Python code
- Python
- >>>Import Django
- >>>django. VERSION
Uninstall Django under Ubuntu