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
会做的