自学内容网 自学内容网

python 打包工具 nuitka 使用笔记

个人感受:

感觉和 pyinstaller 差不多。 目前还没感受到什么差别。
但是有很多人都推荐这个。
当前只是初步尝试,记录一下大体过程。后面有时间了,再找几个例子看看。
比如找点复杂的项目, 或是游戏项目,然后打包一下看看效果。

项目地址 + 文档地址: https://github.com/Nuitka/Nuitka

项目目的: 打包 py ------> exe

安装

python -m pip install -U nuitka

我尝试了 python3.11 失败了。

我尝试了 python3.10 正常。

总之, 一定要需确保 python 的路径是完整的。

记录一些使用技巧

  1. 最简单的使用方式:
    python -m nuitka hello.py
    python -m nuitka random_colors.py

  2. –standalone 跨机器,会产生很多文件以及文件夹。
    python -m nuitka --standalone hello.py

  3. –onefile 单文件,但是文件估计会很大!
    python -m nuitka --onefile hello.py

  4. 多个 py 文件 打包为一个
    python -m nuitka --follow-imports hello.py

todo 尝试更多的参数!


原文地址:https://blog.csdn.net/waterHBO/article/details/140561377

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!