简体   繁体   English

卸载旧版本Django以升级到最新版本

[英]Uninstalling old version Django for upgrade to latest version

I want to upgrade Django from 1.2.5 to 1.3. 我想将Django从1.2.5升级到1.3。 I uninstalled 1.2.5 version, by the Ubuntu Software Center, for future upgrading, but it still in dist-packages and it still imported in python shell. 我卸载了Ubuntu软件中心的1.2.5版本,以便将来升级,但它仍然在dist-packages中,它仍然在python shell中导入。 What should I do? 我该怎么办? Would it be normal if I would brutally deleted the folder and egg from dist-packages? 如果我从dist-packages中粗暴地删除文件夹和蛋,这是正常的吗? It runs on Ubuntu 10.04 它运行在Ubuntu 10.04上

Go to the /usr/local/lib/python2.6/dist-packages . 转到/usr/local/lib/python2.6/dist-packages Find django folder there and delete it. 在那里找到django文件夹并删除它。 then download django 1.3 and run python setup.py install . 然后下载django 1.3并运行python setup.py install This should do the trick. 这应该可以解决问题。

I recommend using setup-tools. 我建议使用setup-tools。 Then run 然后跑

easy_install --upgrade django

It will remove current django path from PYTHON_PATH and will add it's own path. 它将从PYTHON_PATH中删除当前的django路径,并添加它自己的路径。 To get easy_install do: 要获得easy_install,请执行:

apt-get install python-setuptools

For both actions sudo is needed. 对于这两个动作,都需要sudo。

Remove django version using pip : 使用pip删除django版本:

pip uninstall django

And install the version you want, for example 1.5: 并安装所需的版本,例如1.5:

pip install django==1.5

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM