通过pip删除/管理django旧版本 推荐
2014-09-22 15:11
453 查看
最近这段时间,准备继续把django拾起来,断断续续的学习等于等于前功尽弃,学习的效果不是很好,加上这段时间工作上面的事情相对较少,今天中午在休息时间重新搭建了下django环境。
我是在ubuntu12.04(python:2.7.3),安装了django1.7,准备学习,翻阅django的官方文档看了看,注意到
于是乎,为了后面学习的时候不会遇到一些由于版本引起的诡异问题,还是采取跟官方文档适应的相关版本进行学习。所以就需要进行版本的变更。
不晓得各位是怎么安装django的,我是直接解压tgz包,然后python setup.py install 进行安装,问了一些python玩得好的朋友,说卸载django版本是不可以通过setup.py完成的,最好是通过pip进行版本管理。
我是在ubuntu12.04(python:2.7.3),安装了django1.7,准备学习,翻阅django的官方文档看了看,注意到
This tutorial is written for Django 1.7 and Python 3.2 or later. If the Django version doesn’t match, you can refer to the tutorial for your version of Django by using the version switcher at the bottom right corner of this page, or update Django to the newest version. If you are still using Python 2.7, you will need to adjust the code samples slightly, as described in comments.也就是说官方文档讲述的是django1.7跟python3.2版本或者更高版本的相关使用,相关的sample例子也是通过针对这样的版本进行。
于是乎,为了后面学习的时候不会遇到一些由于版本引起的诡异问题,还是采取跟官方文档适应的相关版本进行学习。所以就需要进行版本的变更。
This tutorial is written for Django 1.6 and Python 2.x. If the Django version doesn’t match, you can refer to the tutorial for your version of Django by using the version switcher at the bottom right corner of this page, or update Django to the newest version. If you are using Python 3.x, be aware that your code may need to differ from what is in the tutorial and you should continue using the tutorial only if you know what you are doing with Python 3.x.从以上官方文档上面来看,django1.6与python2.x版本使用较好。
不晓得各位是怎么安装django的,我是直接解压tgz包,然后python setup.py install 进行安装,问了一些python玩得好的朋友,说卸载django版本是不可以通过setup.py完成的,最好是通过pip进行版本管理。
root@ubuntu1204:~# sudo apt-get install python-pip root@ubuntu1204:~/Django-1.7# pip install django==1.6.5 Downloading/unpacking django==1.6.5 Downloading Django-1.6.5.tar.gz (6.6Mb): 6.6Mb downloaded Running setup.py egg_info for package django warning: no previously-included files matching '__pycache__' found under directory '*' warning: no previously-included files matching '*.py[co]' found under directory '*' Installing collected packages: django Found existing installation: Django 1.7 Uninstalling Django: Successfully uninstalled Django Running setup.py install for django changing mode of build/scripts-2.7/django-admin.py from 644 to 755 warning: no previously-included files matching '__pycache__' found under directory '*' warning: no previously-included files matching '*.py[co]' found under directory '*' changing mode of /usr/local/bin/django-admin.py to 755 Successfully installed django Cleaning up...如此,最终看下我们使用的学习组合应该就满足了官方文档版本需求了。
root@ubuntu1204:~# python -V Python 2.7.3 root@ubuntu1204:~# python -c "import django; print(django.get_version())" 1.6.5============================官方文档如是说==================================
If you previously installed Django using python setup.py install, uninstalling is as simple as deleting the django directory from your Pythonsite-packages. To find the directory you need to remove, you can run the following at your shell prompt (not the interactive Python prompt):按照官方文档的意思,如果是通过python setup.py install的方式安装的话,查找到django的安装目录,然后执行删除即可。
root@ubuntu1204:~# python -c "import sys; sys.path = sys.path[1:]; import django; print(django.__path__)" ['/usr/local/lib/python2.7/dist-packages/django']
相关文章推荐
- 跟我做CVS版本管理试验 推荐
- 并行版本管理软件的使用(1)---3W 王泽宾 推荐
- 通过vSphere客户端进行单台ESXi主机管理 推荐
- Python多版本管理软件pyenv的安装应用及pip的使用讲解
- 通过TortoiseGit来使用Github或Visual Studio Online版本控制管理【git之旅】
- Linux用户和组管理,查看软件缓存,通过命令查看硬件信息(cpu,版本,序列号,内存,主板,内核等)
- 推荐一种部署管理DJango项目第三方app的方法
- Oracle数据库通过定义TYPE及Member对象来实现日志信息的分级管理 推荐
- Python多版本管理软件pyenv的安装应用及pip的使用
- 通过webDAV来管理网站上的资源 推荐
- svn版本库管理--版本库中指定版本的删除
- 通过ezjail创建和管理jail虚拟机 推荐
- 原创:通过VS 2010+SVN为SQL Server提供数据库版本管理
- 分类管理模块-删除新闻分类(简单版本)
- 通过VMM2008控制台添加及管理Vmware Esx 3.5 推荐
- 产品版本改造中的项目管理 推荐
- 使用Django开发一个图书管理系统----04.通过admin模块管理我们的app和model
- svn版本库管理--版本库中指定版本的删除