Uninstall Django under Ubuntu

Source: Internet
Author: User
Tags install django



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,


    1. and delete the "easy-install.pth" in the egg reference can be.
    2. 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
    1. 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
    1. Python setup.py Install


Can.






4. View Django Version information






Command-line window:





Python code
    1. Python
    2. >>>Import Django
    3. >>>django. VERSION








Uninstall Django under Ubuntu


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.