error: invalid command 'bdist_egg'

LastTigerEyes picture LastTigerEyes · Aug 26, 2013 · Viewed 9.1k times · Source

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.

    <me>@<compname>:~/Desktop/SANDBOX/somedir$ python setup.py bdist_egg
    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: setup.py --help [cmd1 cmd2 ...]
       or: setup.py --help-commands
       or: setup.py cmd --help

    error: invalid command 'bdist_egg'

What I know so far: When I enter the command,

    $ python setup.py --help-commands

I get back all the normal commands, but not the "extra commands". I have tried googling and searching Stack Overflow but have yet to yield any useful results. I understand I am most likely missing a dependency but I had believed I installed all required parts to make this work.

Any insight is much appreciated. Thanks.

Answer

Martijn Pieters picture Martijn Pieters · Aug 26, 2013

bdist_egg is a command supplied by setuptools. Make sure you import from that project in setup.py, not from distutils:

from setuptools import setup

The tutorial does tell you to do this, but it appears you missed that part.