开发者

How do I use py2exe with paver?

I'm using paver to build my Python application, and I'd like开发者_如何学C to create an executable using py2exe. I've got the following in my pavement.py:

from paver.setuputils import setup
from distutils.core import setup
import py2exe

import paver
paver.setuputils.install_distutils_tasks()

... but when I run paver py2exe I get "Build failed: py2exe is not a Task". What am I doing wrong?


From the tutorial, you just pass your "main" python script to the setup command:

from distutils.core import setup
import py2exe

setup(console=['hello.py'])

Have you tried building your execuable this way?


You are overwriting paver's setup with distutils one.

Also, calling paver.setuputils.install_distutils_tasks() is not needed; just call setup in same was as You do in setup.py.


I too am trying to use py2exe from paver. However, I ran into the problem described here and from that (and some other googling around) my conclusion is that the two aren't integrated and that the cleanest thing to do is to maintain a separate setup.py for py2exe and hope distutils2 improves things.

However, I would be very happy to be proven wrong..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜