Django 卸载
删除任何旧版本的Django
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
<span style="font-family: 微软雅黑;"><span style="font-size: small;">如果你打算从过去的一个版本升级</span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">Django, </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">你需要先删除老版本的</span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">Django</span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">之后</span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">, </span></span> <span style="font-family: 微软雅黑;"><span style="font-size: small;">再安装新的版本</span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">.</span></span> <span style="font-family: 微软雅黑;"><span style="font-size: small;">如果你是通过执行命令 </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">``setup.py install`` </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">来安装 </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">Django, </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">卸载的方法很简单</span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">, </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;"> </span></span> <span style="font-family: 微软雅黑;"><span style="font-size: small;">只要在</span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">``site-packages`` </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">目录下删除 </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">``django`` </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">目录就可以了</span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">.</span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;"> </span></span> <span style="font-family: 微软雅黑;"><span style="font-size: small;">如果你使用 </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">Python egg </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">来安装 </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">Django, </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">直接删除 </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">Django ``.egg`` </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">文件</span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">, </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;"> </span></span> <span style="font-family: 微软雅黑;"><span style="font-size: small;">并且删除 </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">``easy-install.pth``</span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">中的 </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">egg </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">引用就可以了</span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">.</span></span> <span style="font-family: 微软雅黑;"><span style="font-size: small;">这个文件应当可以在 </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">``site-packages`` </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">目录中被找到</span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">... </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;"> </span></span> <span style="font-family: 微软雅黑;"><span style="font-size: small;">提示</span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">:: </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">如何找到 </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">``site-packages`` </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">目录</span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">?</span></span> <span style="font-family: 微软雅黑;"><span style="font-size: small;">``site-packages`` </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">目录的位置取决于使用何种操作系统以及 </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">Python </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">的安装位置</span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">. </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;"> </span></span> <span style="font-family: 微软雅黑;"><span style="font-size: small;">可以通过如下的命令来显示出 </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">``site-packages`` ::</span></span> <span style="font-family: 微软雅黑;"><span style="font-size: small;">python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"</span></span> <span style="font-family: 微软雅黑;"><span style="font-size: small;">(</span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">注意</span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">,</span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">上面的命令请在</span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">shell </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">中执行</span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">,</span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">不是在 </span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">Python</span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">中执行</span></span><span style="font-family: 微软雅黑;"><span style="font-size: small;">.)</span></span> |
GreatGhoul
很有趣,留作记念,随着版本的更新,一定会用到的。