I've finally figured out how to create a Python egg and gotten it to work. Now... what do I do with it? How do I use it? How do I ensure that everything was correctly included? (Simple steps please... not just redirection to another site. I've googled, but it's confusing me, and I was hoping someone could explain it in a couple of simple bullet points or sentences.)
Edit:
I asked this question a couple of weeks ago, and I'm clarifying now in the hope of getting clearer answers... basically, I have an egg, I want to take it to another machine and be able to use it and import modules from it from my (other, unrelated) code. How do I do this?
A python egg is a "a single-file importable distribution format". Which is typically a python package. You can import the package in the egg as long as you know it's name and it's in your path. You can execute a package using the "-m" option and the package name.
egg files are deprecated and are replaced by Wheel format. Since DSS uses pip which does not support installing egg format you won't be able to add egg packages directly from DSS.
I'd advise only using python setup.py sdist
to create zips and/or tarballs, and skip eggs.
If you want to look at the egg it is a zip file; you can use unzip -v MyEgg-0.1.egg
and see its contents to see if includes all the files you expect. You can also try installing it. Use virtualenv to create a new environment (use --no-site-packages
to make it isolated) and try installing it into that environment, like:
$ 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 like you expect. You can do all the same things to test an sdist too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With