Can pip (or setuptools, distribute etc…) list the license used by each installed package?

Here is a copy-pasteable snippet which will print your packages. Requires: prettytable (pip install prettytable) Code import pkg_resources import prettytable def get_pkg_license(pkg): try: lines = pkg.get_metadata_lines(‘METADATA’) except: lines = pkg.get_metadata_lines(‘PKG-INFO’) for line in lines: if line.startswith(‘License:’): return line[9:] return ‘(Licence not found)’ def print_packages_and_licenses(): t = prettytable.PrettyTable([‘Package’, ‘License’]) for pkg in sorted(pkg_resources.working_set, key=lambda x: str(x).lower()): … Read more

How can I install various Python libraries in Jython?

Some Python modules, like lxml, have required components in C. These won’t work in Jython. Most Python packages will work fine, and you can install them using the same tools as you use in CPython. This is described in Appendix A of Jython Book: To get setuptools, download ez_setup.py from http://peak.telecommunity.com/dist/ez_setup.py. Then, go to the … Read more

Why is Python easy_install not working on my Mac?

Check your /usr/bin and /usr/local/bin for easy_install installations and remove any old script: sudo rm -f /usr/bin/easy_install* sudo rm -f /usr/local/bin/easy_install* Download and run distribute: curl -O https://svn.apache.org/repos/asf/oodt/tools/oodtsite.publisher/trunk/distribute_setup.py sudo python distribute_setup.py sudo rm distribute_setup.py Try again, and enjoy. E.g.: sudo easy_install pip

stopping setup.py from installing as egg

Solution 1: I feel like I’m missing something subtle or important (encountering this page years after the question was asked and not finding a satisfying answer) however the following works fine for me: python setup.py install –single-version-externally-managed –root=/ Compressed *.egg files are an invention of setuptools (I’m not a big fan of them although I … Read more

The problem with installing PIL using virtualenv or buildout

The PIL version packaged on pypi (by the author) is incompatible with setuptools and thus not easy_installable. People have created easy_installable versions elsewhere. Currently, you need to specify a find-links URL and use pip get a good package: pip install –no-index -f http://dist.plone.org/thirdparty/ -U PIL By using pip install with the –no-index you avoid running … Read more