Newbie simple py2exe problem

Bubba bub at joos.us
Sun Jan 12 07:38:51 EST 2003


On Sat, 11 Jan 2003 14:05:21 -0600, Michael Urban
<urba0083 at tc.umn.edu> wrote:
Since you guys are so good at this, how about this, I promise I'm
going to learn this as soon as I get this cleared up, thanks.


C:\Python22>python setup.py py2exe
Traceback (most recent call last):
  File "setup.py", line 7, in ?
    scripts=["counter.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__'

C:\Python22>
 

>Bubba wrote:
>
> > This is my setup.py
> > # setup.py
> >    from distutils.core import setup
> >    import py2exe
> >
> >    setup(name="counter",
> >          scripts=["counter.py"],
> >    )
>
>
>And therein lies your syntax error. "from distutils.core import setup" 
>cannot be indented since Python uses indentation for delimiting code 
>blocks. "from" is part of the main block. Indenting it is causing the 
>syntax error. That's why the carrot in the traceback is pointing to the 
>first letter of "from" as well.
>
>You also need to remove the indentation from all of the other statements 
>because they are all part of the main code block. My fortune telling for 
>you is that if you only remove it from the one starting with "from", the 
>next error you will get is:
>
>C:\Python22>python setup.py py2exe
>   File "setup.py", line 4
>     import py2exe
>     ^
>SyntaxError: invalid syntax
>
>Remove the intendations and you should be fine.





More information about the Python-list mailing list