Python - py2exe - 弃用警告

发布于 2024-10-13 18:27:21 字数 1024 浏览 2 评论 0原文

我已经安装了 python 2.6 和新版本的 py2exe。

hello.py

print "Hello from py2exe"

setup.py

from distutils.core import setup
import py2exe

setup(
    # The first three parameters are not required, if at least a
    # 'version' is given, then a versioninfo resource is built from
    # them and added to the executables.
    version = "0.5.0",
    description = "py2exe sample script",
    name = "py2exe samples",

    # targets to build
    windows = ["test_wx.py"],
    console = ["hello.py"],
    )

我已经在控制台中尝试过此操作

python setup.py install

,但收到此错误消息

D:\Python26\lib\site-packages\py2exe\build_exe.py:16: DeprecationWarning: the sets module is deprecated
import sets
running install
running build
running install_egg_info
Removing D:\Python26\Lib\site-packages\py2exe_samples-0.5.0-py2.6.egg-info
Writing D:\Python26\Lib\site-packages\py2exe_samples-0.5.0-py2.6.egg-info

我做错了什么?我该如何修复它?

I've installed python 2.6 and new version of py2exe.

hello.py

print "Hello from py2exe"

setup.py

from distutils.core import setup
import py2exe

setup(
    # The first three parameters are not required, if at least a
    # 'version' is given, then a versioninfo resource is built from
    # them and added to the executables.
    version = "0.5.0",
    description = "py2exe sample script",
    name = "py2exe samples",

    # targets to build
    windows = ["test_wx.py"],
    console = ["hello.py"],
    )

and I've tried this in console

python setup.py install

but I get this error message

D:\Python26\lib\site-packages\py2exe\build_exe.py:16: DeprecationWarning: the sets module is deprecated
import sets
running install
running build
running install_egg_info
Removing D:\Python26\Lib\site-packages\py2exe_samples-0.5.0-py2.6.egg-info
Writing D:\Python26\Lib\site-packages\py2exe_samples-0.5.0-py2.6.egg-info

What did I wrong? how can I fix it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

渔村楼浪 2024-10-20 18:27:21

这不是一个错误,它只是一个关于已弃用的类的警告;在这种情况下,sets 模块已被弃用,新代码现在应该使用内置的 set 类。

Its not an error, its just a warning about a deprecated class; in this case the sets module is deprecated and the new code should use built-in set class now.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文