python中软件包有哪些_如何在Python中列出所有已安装的软件包及其版本?

Andbdrew..

5

用pip安装包,你可以做一个

pip freeze

它将列出所有已安装的软件包.您可能也应该使用virtualenv和virtualenvwrapper.当你开始一个新项目时,你可以做到

mkvirtualenv my_new_project

然后(在那个virtualenv内),做

pip install all_your_stuff

这样,您可以workon my_new_project随后pip freeze查看为该virtualenv /项目安装的软件包.

例如:

? ~ mkvirtualenv yo_dude

New python executable in yo_dude/bin/python

Installing setuptools............done.

Installing pip...............done.

virtualenvwrapper.user_scripts creating /Users/aaylward/dev/virtualenvs/yo_dude/bin/predeactivate

virtualenvwrapper.user_scripts creating /Users/aaylward/dev/virtualenvs/yo_dude/bin/postdeactivate

virtualenvwrapper.user_scripts creating /Users/aaylward/dev/virtualenvs/yo_dude/bin/preactivate

virtualenvwrapper.user_scripts creating /Users/aaylward/dev/virtualenvs/yo_dude/bin/postactivate

virtualenvwrapper.user_scripts creating /Users/aaylward/dev/virtualenvs/yo_dude/bin/get_env_details

(yo_dude)? ~ pip install django

Downloading/unpacking django

Downloading Django-1.4.1.tar.gz (7.7Mb): 7.7Mb downloaded

Running setup.py egg_info for package django

Installing collected packages: django

Running setup.py install for django

changing mode of build/scripts-2.7/django-admin.py from 644 to 755

changing mode of /Users/aaylward/dev/virtualenvs/yo_dude/bin/django-admin.py to 755

Successfully installed django

Cleaning up...

(yo_dude)? ~ pip freeze

Django==1.4.1

wsgiref==0.1.2

(yo_dude)? ~

或者如果你有一个带有requirements.pip文件的python包,

mkvirtualenv my_awesome_project

pip install -r requirements.pip

pip freeze

会做的

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值