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
8
votes
1 answer

Python: If there are multiple egg versions of the same package installed, how do I import specifically the version I need?

Say, for example that FooPackage-1.1 and FooPackage-1.2 are both installed in dist-packages as eggs. How do I import the one I need?
Ken Kinder
  • 12,654
  • 6
  • 50
  • 70
8
votes
1 answer

Exclude single source file from python bdist_egg or bdist_wheel

Background: I have one source file which is responsible for security. In there are magic keys and specific algorithms. Is it possible to remove a this single source file from a python egg or wheel package? I already accomplished to ship only binarys…
Niecore
  • 312
  • 3
  • 10
8
votes
2 answers

What is the point of Python egg files?

When I run python setup.py install django, it generates an egg file. What is the usefulness of Python egg files?
zjm1126
  • 34,604
  • 53
  • 121
  • 166
8
votes
1 answer

cx_freeze and single-file eggs

I'm trying to use cx_freeze on Windows 7 with a python2.7 distutils script, and it seems to get tripped up on 2 packages: rsa & pyasn1: error: [Error 3] The system cannot find the path…
Scott Hunter
  • 48,888
  • 12
  • 60
  • 101
8
votes
3 answers

Importing Python libraries and gracefully handling if they are not availalble

I would like to import bunch of libraries and catch the exception. If I have only 1 try catch block I get 1 exception (the first one). Is there a pattern to iterate over all of the libs and have a separate exception for each individual missing…
Istvan
  • 7,500
  • 9
  • 59
  • 109
8
votes
4 answers

Python Code Organization Question : Eggs + Packages + Buildout + Unit Tests + SVN

I have several python projects that share common modules. Until now, I've been ... ahem ... keeping multiple copies of the common code and synchronizing by hand. But I'd clearly prefer to do something else. It looks to me now, as if zc.Buildout…
interstar
  • 26,048
  • 36
  • 112
  • 180
8
votes
1 answer

Python import library from tar.gz?

I am working on a box which I don't have root access. However, there is a folder /share which would be accessed for everyone to read and write. I want to figure out a way to put python libraries so that everyone could access and use them. I…
B.Mr.W.
  • 18,910
  • 35
  • 114
  • 178
7
votes
4 answers

What are the best practices for creating Python Distributions(eggs) on(and for) Multiple Operating Systems

Ours is a python shop. We have different python packages developed inhouse and will be deployed onto customers' environments(machines). This is how our development and release cycle happens. Once developers complete "testing" of a package, a…
Nanda Kishore
  • 2,789
  • 5
  • 38
  • 61
7
votes
2 answers

Is zip_safe only relevant for the egg format?

If I read this correctly, then the egg format is something one should not use anymore. Instead, one should use the wheels format. Others seem to read this the same way. With this assumption: Is zip_safe relevant for any other distribution format…
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
7
votes
1 answer

Python wheel: "ModuleNotFoundError" after installing package

OS: Windows 7 Python: 3.6 I'm trying to create and installing a python wheel package. The building works fine but when i import the module into project after installing it, i get a "ModuleNotFound" error. My project has the following…
NoNAmE
  • 73
  • 1
  • 4
7
votes
4 answers

Access a file from a python egg

Hi I am working with python packaging. I have 3 non-code files namely ['synonyms.csv', 'acronyms.csv', 'words.txt']. These files exist in a folder structure Wordproject/WordProject/Repository/DataBank/ I have a RepositoryReader class at the path…
iam.Carrot
  • 4,976
  • 2
  • 24
  • 71
7
votes
1 answer

how to make "python setup.py install" install source instead of egg file?

I used to run python setup.py install in a python project, it will just move the source to site-packages, but sometimes it will mv an egg file to site-packages? #!/usr/bin/env python # encoding: utf-8 from setuptools import…
roger
  • 9,063
  • 20
  • 72
  • 119
7
votes
1 answer

Module found in install mode but not in develop mode using setuptools

I'm using setuptools for the first time, and trying to package my code so that others can easily develop it. I'm running everything in a virtual environment. Short question: How do I change the directory that the egg-link points to when I run…
Nick Sweet
  • 2,030
  • 3
  • 31
  • 48
7
votes
2 answers

Disadvantage of Python eggs?

Are there any disadvantages about using eggs through easy-install compared to the "traditional" packages/modules/libs?
Jorge Guberte
  • 10,464
  • 8
  • 37
  • 56
7
votes
2 answers

Building an egg of my python project

Can somebody please guide me with step-by-step procedure on how to eggfy my existing python project? The documentation is keep mentioning something about setup.py within a package but I cannot find it in my project... thank you,
Jin-Dominique
  • 3,043
  • 6
  • 19
  • 28