• Martin Thoma
  • Home
  • Categories
  • Tags
  • Archives
  • Support me

Packaging with Python

Contents

  • Packaging with Python
    • Package Management Tools
      • Distutils
      • Setuptools
      • Distribute
    • PIP and Creating packages
    • Environments
This is a quick article I had for quite a while as a draft. It might not be finished or have other problems, but I still want to share it. I wrote this when I did not know much about packaging. I wrote a tutorial how to create Python packages in 2018 as well. In 2020, I gave a Python Packaging Course which is better structured, up-to-date and has way more details.

The following article is a wrap-up of the talk Python Packages from Daniel Hepper given at a German PyCon 2013.

PyPi is the Python Package Index. They distribute packages in form of "eggs". You can install them with easy_install or with pip.

Package Management Tools

Distutils

Distutils is part of the standard library. When you run

python setup.py install

then distutils is running.

Major disadvantages of distutils are:

  • No Meta-data:
  • no deinstallation
  • no dependencies
  • No Package listing (so you can't automatically search pypi)

Setuptools

Setuptools is an extension for distutils. Setuptools offers dependency management. With setuptools, so called 'egg files' were introduced. Those files are comparable to jar files in Java.

Distribute

Distribute was a fork of setuptools that got merged back to setuptools. So don't use distribute, use setuptools.

PIP and Creating packages

See Python Packaging Course

Environments

See Virtual Environments


Published

Dez 29, 2014
by Martin Thoma

Category

Code

Tags

  • Python 141

Contact

  • Martin Thoma - A blog about Code, the Web and Cyberculture
  • E-mail subscription
  • RSS-Feed
  • Privacy/Datenschutzerklärung
  • Impressum
  • Powered by Pelican. Theme: Elegant by Talha Mansoor