Questions tagged [egg]

A python egg is a file used for distributing python projects as bundles; it is usually compressed with the zip algorithm. Egg files normally include some metadata; the file extension is ".egg". The concept is very similar to a Java .jar file.

An egg is a bundle that contains all the package data. In the ideal case, an egg is a zip-compressed file with all the necessary package files. But in some cases, Python's setuptools decides (or is told via CLI switches) that a package should not be zip-compressed. In those cases, an egg is simply an uncompressed subdirectory, but with the same contents. The single file version is useful for transporting, and saves a little bit of disk space, but an egg directory is functionally and organizationally identical. The concept is very similar to a Java .jar file.

You may use an egg simply by pointing your shell environment's PYTHONPATH or Python's sys.path at it and importing as you normally would, for Python versions >= 2.5. If you wish to take this approach, you do not need to bother with setuptools or ez_setup.py at all.

354 questions
14
votes
3 answers

Do I have any obligations if I upload an egg to the CheeseShop?

Suppose I'd like to upload some eggs on the Cheese Shop. Do I have any obligation? Am I required to provide a license? Am I required to provide tests? Will I have any obligations to the users of this egg ( if any ) ? I haven't really released…
Geo
  • 93,257
  • 117
  • 344
  • 520
13
votes
1 answer

Difference between prune and recursive-exclude in setuptools?

I am using setuptools to package a custom module for deployment, which should not include certain files in the data/ directory that were used for development. I have succesfully excluded the necessary files using recursive-exclude data/ * in my…
yunque
  • 625
  • 1
  • 8
  • 18
13
votes
2 answers

python: simple example for a python egg with a one-file source file?

I'm not quite sure how to build a really simple one-file source module. Is there a sample module out there one the web somewhere which can be built as a python .egg? From the setuptools page it looks pretty simple, you just have your setup.py file…
Jason S
  • 184,598
  • 164
  • 608
  • 970
12
votes
2 answers

How does Python keep track of modules installed with eggs?

If I have a module, foo, in Lib/site-packages, I can just import foo and it will work. However, when I install stuff from eggs, I get something like blah-4.0.1-py2.7-win32.egg as a folder, with the module contents inside, yet I still only need do…
Claudiu
  • 224,032
  • 165
  • 485
  • 680
12
votes
1 answer

Databricks (Spark): .egg dependencies not installed automatically?

I have a locally created .egg package that depends on boto==2.38.0. I used setuptools to create the build distribution. Everything works in my own local environment, as it fetches boto correctly from PiP. However on databricks it does not…
Loek Janssen
  • 431
  • 1
  • 7
  • 17
12
votes
3 answers

What are simple instructions for creating a Python package structure and egg?

I just completed my first (minor) Python project, and my boss wants me to package it nicely so that it can be distributed and called from other programs easily. He suggested I look into eggs. I've been googling and reading, but I'm just getting…
froadie
  • 79,995
  • 75
  • 166
  • 235
12
votes
2 answers

error: invalid command 'bdist_egg'

I am running: Ubuntu 13.04 Python 2.7.4 I am trying this very simple tutorial on making a python egg, but am having difficulties when I actually try to run the command to make the egg. @:~/Desktop/SANDBOX/somedir$ python setup.py…
LastTigerEyes
  • 647
  • 1
  • 9
  • 21
11
votes
0 answers

Installing egg through pip

I can successfully install egg for morfeusz2 through python -m easy_install http://sgjp.pl/morfeusz/download/20181014/ubuntu-xenial/morfeusz2-0.4.0-py3.7-win-amd64.egg However, all other dependencies I define through requirements.txt. I would like…
dzieciou
  • 4,049
  • 8
  • 41
  • 85
11
votes
1 answer

`pip freeze` breaks with package installation

I am installing a package using dependency_links. It seems to install the package alright but breaks pip freeze functionality (which probably means there is a deeper install issue.) I want to be able to download the package from a custom server…
Chris
  • 12,900
  • 12
  • 43
  • 65
11
votes
2 answers

Problem accessing config files within a Python egg

I have a Python project that has the following structure: package1 class.py class2.py ... package2 otherClass.py otherClass2.py ... config dev_settings.ini prod_settings.ini I wrote a setup.py file that converts this into an egg…
froadie
  • 79,995
  • 75
  • 166
  • 235
11
votes
1 answer

zip_safe = False is not working in setup.py file

I want to install my project as a folder instead of .egg file. So I have used zip_safe= False inside setup function in setup.py file But when I am running this my project is getting installed as .egg file instead of a directory inside…
pjain
  • 663
  • 10
  • 21
11
votes
2 answers

Bundle python script and dependencies into a single file

I have a few script that had their own copy of a some functions, so I extracted these functions to a module and had the scripts import the function. These script are to be copied over to a bunch of linux servers and executed. When the scripts worked…
kenneho
  • 401
  • 1
  • 7
  • 24
10
votes
1 answer

Difference between a Python 'egg' and 'wheel'

I was installing pandas on my machine and came across this error: Running setup.py (path:/tmp/pip-build-WzvvgM/pandas/setup.py) egg_info for package pandas Cleaning up... Command python setup.py egg_info failed with error code 1 in…
Sachin Yadav
  • 748
  • 9
  • 28
10
votes
1 answer

include only *.pyc files in python wheel

How can I include only *.pyc files in a python wheel? When creating eggs, it used to be possible to run python setup.py bdist_egg --exclude-source-files Given that eggs have been replaced by wheels, how would I reproduce a similar result?
Zuabi
  • 1,112
  • 1
  • 13
  • 26
9
votes
2 answers

How to prevent setuptools install package as an .egg

For example, installing IPython on Linux (where setuptools is not installed) I've got IPython installed in site-packages\IPython. Installing IPython on Windows (where IPython requires setuptools), after executing the same command python setup.py…
teegaar
  • 876
  • 9
  • 19
1 2
3
23 24