Your SlideShare is downloading. ×
Using Python Packages - An Overview
Using Python Packages - An Overview
Using Python Packages - An Overview
Using Python Packages - An Overview
Using Python Packages - An Overview
Using Python Packages - An Overview
Using Python Packages - An Overview
Using Python Packages - An Overview
Using Python Packages - An Overview
Using Python Packages - An Overview
Using Python Packages - An Overview
Using Python Packages - An Overview
Using Python Packages - An Overview
Using Python Packages - An Overview
Using Python Packages - An Overview
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Using Python Packages - An Overview

2,696

Published on

A short overview over the Python packaging ecosystem.

A short overview over the Python packaging ecosystem.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,696
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
31
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Using Python Packages An Overview Daniel Hepper <daniel.hepper@epicco.de> @danielhepper PyCologne – 12.01.2011
  • 2. Using Python Packages An Overview ● distutils A lot of names, ● Setuptools a lot of confusion. ● easy_install Distribute ??? ● ● pip ● virtualenv ● virtualenvwrapper12.01.2011 Daniel Hepper <daniel.hepper@epicco.de> 2
  • 3. distutils $ python setup.py install ● allows building and installing modules ● part of standard library since Python 1.6 ● no uninstalling or listing of packages ● no dependency handling12.01.2011 Daniel Hepper <daniel.hepper@epicco.de> 3
  • 4. setuptools $ easy_install MyPackage ● created by Phillip J. Eby ● enhancements to distutils ● handles dependencies ● introduces egg files ● download packages from PyPI ● no uninstalling of packages ● currently unmaintained12.01.2011 Daniel Hepper <daniel.hepper@epicco.de> 4
  • 5. Distribute ● created by the The fellowship of the packaging ● fork of setuptools ● drop-in replacement ● actively maintained ● support for Python 312.01.2011 Daniel Hepper <daniel.hepper@epicco.de> 5
  • 6. Pip ● written by Ian Bicking ● stands for Pip Installs Python ● replacement for easy_install ● uninstallation of packages ● requirements files ● native support for other VCS ● no eggs!12.01.2011 Daniel Hepper <daniel.hepper@epicco.de> 6
  • 7. Pip Commands ● install: Install packages ● uninstall: Uninstall packages ● freeze: Output all currently installed packages ● search: Search PyPI ● bundle: Create pybundles ● help: Show available commands ● unzip: Unzip individual packages ● zip: Zip individual packages12.01.2011 Daniel Hepper <daniel.hepper@epicco.de> 7
  • 8. Searching$ pip search djangodjango­gencal             ­ django­gencal is a resuable Djanemencia.django.downloader ­ Downloader app like dl.free.fr idjango­voting             ­ Generic voting application for Ddjango­composition        ­ `django­composition` provides thdjango­invitation         ­ Built on top of django­registrat…django­cnotes             ­ Django cnotes provides a simple django_messages_framework ­ Backport of django (dev)s messablogango                  ­ A django based blogdjango­fancy­autocomplete ­ A simple AJAX autocomplete helpe12.01.2011 Daniel Hepper <daniel.hepper@epicco.de> 8
  • 9. Freezing & Requirements files$ pip freezeBrlapi==0.5.5CouchDB==0.6Couchapp==0.7.2GnuPGInterface==0.3.2GoldenRatio==1.0.0Jinja2==2.5.5Mako==0.3.4MarkupSafe==0.9.2PAM==0.4.2PIL==1.1.7...12.01.2011 Daniel Hepper <daniel.hepper@epicco.de> 9
  • 10. Freezing & Requirements files$ pip freeze > requirements.txt$ pip ­r requirements.txt12.01.2011 Daniel Hepper <daniel.hepper@epicco.de> 10
  • 11. Virtualenv ● written by Ian Bicking ● creates isolated Python environments $ virtualenv ENV ● creates ENV/lib/pythonX.Y/site­packages ● install interpreter in ENV/bin/python ● installs Setuptools, ­­distribute installs Distribute ● no site packages with ­­no­site­packages ● activate with . bin/activate12.01.2011 Daniel Hepper <daniel.hepper@epicco.de> 11
  • 12. virtualenvwrapper ● written by Doug Hellmann ● set of extensions to virtualenv ● puts environments in one place ● easy switching between environments ● hook scripts12.01.2011 Daniel Hepper <daniel.hepper@epicco.de> 12
  • 13. Summary enhanced by replaced by distutils Setuptools Distribute provides provides easy_install replaced by supports pip virtualenv extended with virtualenvwrapper12.01.2011 Daniel Hepper <daniel.hepper@epicco.de> 13
  • 14. References ● distutils documentation http://docs.python.org/library/distutils.html ● setuptools on Python Package Index http://pypi.python.org/pypi/setuptools ● Distribute documentation http://packages.python.org/distribute/ ● Pip documentation http://pip.openplans.org/12.01.2011 Daniel Hepper <daniel.hepper@epicco.de> 14
  • 15. References (cont.) ● virtualenv documentation http://virtualenv.openplans.org/ ● virtualenvwrapper homepage http://www.doughellmann.com/projects/virtualenvwrapper/ ● “Der Eierkocher”, talk by Chris Arndt (German) http://chrisarndt.de/talks/cooking-eggs/cooking-eggs-vortrag.html12.01.2011 Daniel Hepper <daniel.hepper@epicco.de> 15

×