I created a Python egg; Now what?

I finally figured out how to create a Python egg and got it to work. Now ... what should I do about it? How to use it? How can I ensure that everything is properly included? (Simple steps, please ... not just redirecting to another site. I searched googled, but it baffled me, and I was hoping someone could explain it in a few simple paragraphs or sentences.)

Edit

I asked this question a couple of weeks ago, and now I clarify in the hope of getting clearer answers ... basically, I have an egg, I want to take it to another machine and use it and import modules from it from mine (another, unrelated ) code. How to do it?

+6
python egg distribution
source share
2 answers

What I did in the end:

  • Ran PYTHONPATH=fullPathOfMyEgg at the command line
  • Then was able to execute import someModuleInMyEgg from my Python code

I'm not sure if this is the most standard or acceptable way to do this, but it worked. If anyone has any comments or other methods, please feel free to add ...

0
source share

I would suggest using python setup.py sdist to create zip and / or tarballs and skip eggs.

If you want to look at an egg, this is a zip file; you can use unzip -v MyEgg-0.1.egg and look at its contents to see if all the files you expect include. You can also try installing it. Use virtualenv to create a new environment (use --no-site-packages to isolate it) and try installing it in this environment, for example:

 $ virtualenv --no-site-packages test-env $ ./test-env/bin/easy_install path/to/MyEgg-0.1.egg $ ./test-env/bin/python 

And then see if you can import it and use your package as you expect. You can do the same to check sdist too.

+6
source share

All Articles