Create an egg file example

To create an .egg file do next:

Create a directory, we will call it chiken. Put your python source code (one or several python scripts) now create file near the directory:

from setuptools import setup, find_packages
    name = "chiken",
    version = "0.1",
    packages = find_packages()

Then, run in the terminal:

 python bdist_egg

This will generate some outputs, but when it’s done you’ll see that you have three new folders: 

  1. build
  2. dist
  3. chiken.egg-info

The only folder that we need is the dist where you'll find your .egg file, chiken-0.1-py3.5.egg with your default python (installation) version number (in our example: 3.5).

You can share this egg with anyone else.

To install it they can apply:

easy_install chiken-0.1-py3.5.egg

Image for a hint

#python #egg
Ivan Borshchov profile picture
May 08, 2021
by Ivan Borshchov
Did it help you?
Yes !

Best related