Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install a python egg

I'm trying to setup ftw.mail for my postfix installation. Since I'm new to Linux and Python I don't really have a clue whether it is right, goes in the right direction or is rubbish.

From the official documentation I found this:

  • Add ftw.mail to your buildout configuration:
    [instance]
    eggs +=
    ftw.mail
  • Install the generic setup import profile.

(source: https://github.com/4teamwork/ftw.mail/blob/master/README.rst)

My first question is: Would "/etc/postfix/" the so called "buildout configuration"?

Secondly I had struggles in how to build this "egg" I tried:

$ wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python for ez_setup

then:

$ sudo apt-get install python-setuptools

and to finish:

$ sudo easy_install ftw.mail

On the console I was told, that the egg was there:

/usr/local/lib/python2.7/dist-packages/ftw.mail-2.3.1-py2.7.egg

I found it and I've read that I had to start it with:

$ PYTHONPATH=/usr/local/lib/python2.7/dist-packages/cssutils-1.0-py2.7.egg

which basically did nothing. Now the question is: How do I install the egg?

To summarise my questions:

  1. Is "etc/postfix/" the buildout configuration directory I'm looking for?
  2. How do I install a Python egg?
  3. And what am I supposed to do with:[instance] eggs += ftw.mail?
  4. What is a "generic setup import profile"?
like image 980
Peter Avatar asked Jun 05 '15 15:06

Peter


People also ask

How do I create an egg in Python?

To get started creating an egg, you will need to create a new folder and put the mymath folder inside it. Then create a setup.py file in the parent directory to mymath with the following contents: Python has its own package for creating distributions that is called distutils.

How to uninstall an egg in Python?

Uninstalling an egg is a bit tougher. You will have to go to its install location and delete the folder and / or egg file it installed as well as remove the entry for the package from the easy-install.pth file. All of these items can be found in your Python’s site-packages folder.

How do I upload an egg or source to PyPI?

If you want to, you also use easy_install to upload your egg or source directly to the Python Package Index (PyPI) by using the following commands (copied from docs): setup.py bdist_egg upload # create an egg and upload it. setup.py sdist upload # create a source distro and upload it.

Where can I find Python eggs?

Where do I find Python Eggs? You can find Python Eggs on quite a few places on the web, e.g. at a package author’s website. The biggest repository of eggs is the Cheeseshop (or PyPI) though), an index for Python packages.


1 Answers

I think I did it by:

$ sudo easy_install /usr/local/lib/python2.7/dist-packages/cssutils-1.0-py2.7.egg
like image 163
Peter Avatar answered Sep 24 '22 02:09

Peter