安装win安装选择8.1.0
64位系统建议选择x86_64-posix-sjlj
32位系统建议选择i686-posix-sjlj
设置环境变量 C:\mingw64\bin, 添加到Path目录(仅windows需要操作)
linux安装
apt install gcc
// centos
yum install gcc
使用pip 安装
pip install nuitka
2. 选择需要加密的代码及模块
比如需要将一个项目进行打包,项目结构:
proj
- modA
- modB
start.py
项目proj通过start.py进行启动,那么打包命令为
nuitka3 --follow-import-to=modA --follow-import-to=modB --output-dir=out start.py
此时会生成out目录,里面有对应的可执行文件,只要把对应下可执行文件放到同样环境的电脑即可运行。windows下需要添加参数 --mingw64
如果项目proj使用到了numpy或tensorflow, 需要添加参数
--plugin-enable=numpy --plugin-enable=tensorflow
nuitka --plugin-list查看可用的插件
data-files
dill-compat
enum-compat
eventlet Required by the eventlet package
gevent Required by the gevent p