12

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.

LastTigerEyes
  • 647
  • 1
  • 9
  • 21

2 Answers2

15

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.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
  • You are absolutely correct. I had the line "from distutils.core import setup" by mistake, still leftover from the previous example they had. Many thanks. – LastTigerEyes Aug 26 '13 at 20:26
  • 1
    The setup.py provided with pycrypto 2.6.1 did not have `bdist_egg` as a command. Adding the import line as above worked and I could build the egg file for it. – Fred Yankowski Apr 09 '15 at 16:02
3

I had a similar issue then I realized that I need too install the setuptools first, oops:

Setup Tools Installation Instructions

Human
  • 8,380
  • 2
  • 19
  • 15