Py2exe error messages

Discussion in 'Python' started by Ray, Nov 1, 2003.

  1. Ray

    Ray Guest

    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

    C:\Python22>python setup.py py2exe --icon EXE icon
    Traceback (most recent call last):
    File "setup.py", line 7, in ?
    scripts = ["wxApp1.py"],
    File "C:\Python22\distutils\core.py", line 101, in setup
    _setup_distribution = dist = klass(attrs)
    File "C:\Python22\distutils\dist.py", line 130, in __init__
    setattr(self, method_name, getattr(self.metadata, method_name))
    AttributeError: DistributionMetadata instance has no attribute
    'get___doc__'

    This is the error message I'm getting when I try to run
    This is my setup script:

    from distutils.core import setup
    import py2exe

    setup(name = 'Notebook',
    version = '0.1',
    description = 'Simple Text Editor',
    author = 'Ray Sleeper',
    author_email = '',
    url = ' ',
    scripts = ["wxApp1.py"],
    I'm using Python2.2 and Boa0.2.3 if that helps
    Why am I getting this error message?
    Ray, Nov 1, 2003
    #1
    1. Advertising

  2. Ray

    Giles Brown Guest

    "Ray" <> wrote in message news:<>...
    > Microsoft Windows XP [Version 5.1.2600]
    > (C) Copyright 1985-2001 Microsoft Corp.
    >
    > C:\Python22>python setup.py py2exe --icon EXE icon
    > Traceback (most recent call last):
    > File "setup.py", line 7, in ?
    > scripts = ["wxApp1.py"],
    > File "C:\Python22\distutils\core.py", line 101, in setup
    > _setup_distribution = dist = klass(attrs)
    > File "C:\Python22\distutils\dist.py", line 130, in __init__
    > setattr(self, method_name, getattr(self.metadata, method_name))
    > AttributeError: DistributionMetadata instance has no attribute
    > 'get___doc__'
    >
    > This is the error message I'm getting when I try to run


    Hmmm. Have you taken a good look at the distutils/dist.py code?

    On my 2.2.2 installation the nearest match (which strangely isn't
    line exactly on line 130) is this chunk of code:

    """
    # Store the distribution meta-data (name, version, author, and so
    # forth) in a separate object -- we're getting to have enough
    # information here (and enough command-line options) that it's
    # worth it. Also delegate 'get_XXX()' methods to the 'metadata'
    # object in a sneaky and underhanded (but efficient!) way.
    self.metadata = DistributionMetadata()
    for basename in self.metadata._METHOD_BASENAMES:
    method_name = "get_" + basename
    setattr(self, method_name, getattr(self.metadata, method_name))
    """

    Don't know if I'm teach grandma to suck eggs here, but this
    code it constructing a metadata sub-object and "stealing" certain
    "get" functions from it to pass off as its own. The list of
    attributes that it is prepared to get is taken from
    Distribution._METHOD_BASENAMES (in the same file).

    Looking at the version of this from my installation I see:

    '''
    class DistributionMetadata:
    """Dummy class to hold the distribution meta-data: name, version,
    author, and so forth.
    """

    _METHOD_BASENAMES = ("name", "version", "author", "author_email",
    "maintainer", "maintainer_email", "url",
    "license", "description", "long_description",
    "keywords", "platforms", "fullname", "contact",
    "contact_email", "licence")
    '''

    This leads to the question where is the loop in the extract above
    getting the "__doc__" from that is using to build the method name?

    You may want to inspect your the distutils code in your python installation
    (and maybe put a few print statements into it) to investigate.

    Hope this helps.
    Regards,
    Giles
    Giles Brown, Nov 2, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nick
    Replies:
    3
    Views:
    292
    Anand Pillai
    Jan 5, 2004
  2. F. GEIGER
    Replies:
    0
    Views:
    908
    F. GEIGER
    Aug 16, 2004
  3. python
    Replies:
    3
    Views:
    1,765
    Simon Brunning
    May 22, 2006
  4. Chris Spencer

    Re: [Py2exe-users] py2exe 0.6.9 released

    Chris Spencer, Nov 17, 2008, in forum: Python
    Replies:
    3
    Views:
    561
    Pascal
    Dec 8, 2008
  5. Mark Hammond

    RE: [Py2exe-users] py2exe 0.6.9 released

    Mark Hammond, Nov 17, 2008, in forum: Python
    Replies:
    0
    Views:
    448
    Mark Hammond
    Nov 17, 2008
Loading...

Share This Page