Uninstall Django completely

前端 未结 10 2229
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-24 10:01

I uninstalled django on my machine using pip uninstall Django. It says successfully uninstalled whereas when I see django version in python shell, it still give

10条回答
  •  半阙折子戏
    2020-12-24 10:29

    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.

提交回复
热议问题