Newbie simple py2exe problem

Bubba bub at joos.us
Sun Jan 12 07:15:32 EST 2003


On Sat, 11 Jan 2003 14:05:21 -0600, Michael Urban
<urba0083 at tc.umn.edu> wrote:Thanks Mike, that fixed the problem, now
I've got additional errors. I'll se if I can resolve these before
posting. I'm simply trying to see if I can create a windows executable
before spending time learning Python, I guess this is obvious. I am
also using PythonCard, this may be part of the problem.

>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