Python gets all the installation packages __python

Source: Internet
Author: User
To get all installed package:
Mode one:
1. Select Tools-Run manage.py task
2. Typing command shell


Mode two:
1. Select Tools--Start SSH session--Select the project corresponding to the vagrant
2. (Python-django) vagrant@precise64:~$ cd/vagrant/
3. (python-django) vagrant@precise64:/vagrant$ python manage.py Shell


Import pip
Installed_packages = Pip.get_installed_distributions ()
Installed_packages_list = sorted (["%s==%s"% (I.key, i.version) for I in Installed_packages])
Print (installed_packages_list)


As a (too long) one liner:


Sorted (["%s==%s"% (I.key, i.version) for I in Pip.get_installed_distributions ()])
Giving:


[' behave==1.2.4 ', ' enum34==1.0 ', ' flask==0.10.1 ', ' itsdangerous==0.24 ',
' jinja2==2.7.2 ', ' jsonschema==2.3.0 ', ' markupsafe==0.23 ', ' nose==1.3.3 ',
' parse-type==0.3.4 ', ' parse==1.6.4 ', ' prettytable==0.7.2 ', ' requests==2.3.0 ',
' six==1.6.1 ', ' vioozer-metadata==0.1 ', ' vioozer-users-server==0.1 ',
' werkzeug==0.9.4 ']
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.