【问题标题】:Python 3.5 - Compile pygame code with nuitkaPython 3.5 - 使用 nuitka 编译 pygame 代码
【发布时间】:2016-09-23 11:53:08
【问题描述】:

我想编译一个我用 Python 制作的游戏。我四处寻找编译器,我更喜欢 Nuitka,因为它是跨平台的。但是,每当我尝试使用 nuitka --recurse-all --standalone myappname.py 使用 Nuitka 编译我的代码时,我都会收到此错误:

Cannot find 'pygame' as relative or absolute import.

我已经安装了 pygame,谁能帮帮我?

PS:我不想使用像 cx_freeze 这样的“编译器”

提前致谢

【问题讨论】:

    标签: python-3.x compilation pygame nuitka


    【解决方案1】:

    首先,执行:pip install pygame 第二:确保在主应用模块之上有正确的导入语句。

    【讨论】:

    • 用 cxfreeze 编译可以工作,所以这不是问题
    • @StamKaly 您是否以正确的方式启动 Nuitka?我的意思是,在 Windows 上首先启动 Visual C 命令提示符,然后将目录更改为您的应用程序并运行 Nuitka?或者你有 MinGW 吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-03-29
    • 1970-01-01
    • 2022-07-09
    • 2018-05-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多