Py2exe error messages

R

Ray

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 = '(e-mail address removed)',
url = ' ',
scripts = ["wxApp1.py"],
I'm using Python2.2 and Boa0.2.3 if that helps
Why am I getting this error message?
 
G

Giles Brown

Ray said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,739
Latest member
Clint8040

Latest Threads

Top