Ernestpneug 发表于 2025-10-26 20:44:37

Python PyInstaller 高级打包工具

在论坛上找python打包工具,一直没找一个合适的,那就自己来做一个。
安装好python环境,安装好PyInstaller, 用命令:pip --install PyInstaller




寒哥Gh61ac8 发表于 2025-10-26 20:45:04

期待大佬来一个nuitka打包的,毕竟pyinstaller太容易被解开了

python -m nuitka xxxx.py ^
    --msvc=latest ^
    --standalone ^
    --lto=yes ^
    --show-progress ^
    --enable-plugin=tk-inter ^
    --windows-console-mode=disable ^
    --windows-icon-from-ico=icon.ico ^
    --include-data-file=config.json=config.json

寒哥Gh61ac8 发表于 2025-10-26 20:45:24

感谢分享

风之影赫 发表于 2025-10-26 20:45:33

很方便的工具,谢谢

风之影赫 发表于 2025-10-26 20:46:00

PyInstaller\loader\pyimod02_importers.py:450: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
Traceback (most recent call last):
File "texe.py", line 1, in <module>
    import pandas as pd
File "PyInstaller\loader\pyimod02_importers.py", line 450, in exec_module
File "pandas\__init__.py", line 31, in <module>
ImportError: Unable to import required dependencies:
numpy: Error importing numpy: you should not try to import numpy from
      its source directory; please exit the numpy source tree, and relaunch
      your python interpreter from there.
Failed to execute script 'texe' due to unhandled exception!
打包运行提示这个 请问是什么原因

风之影赫 发表于 2025-10-26 20:46:30

刷到的工具就是比自己找的好用

寒哥Gh61ac8 发表于 2025-10-26 20:47:24

提个建议,希望支持设置读取虚拟环境内的pyinstaller,目前为了环境隔离,项目使用uv管理,目前这个工具不支持自定义命令前缀(如配置项目路径后使用uv run pyinstaller ...)或配置虚拟环境,无法打包虚拟环境内项目,要是能支持配置虚拟环境就好了,谢谢!

寒哥Gh61ac8 发表于 2025-10-26 20:47:44

感谢分享

huoxianghui913 发表于 2025-10-26 20:47:50

感谢楼主分享

风之影赫 发表于 2025-10-26 20:48:32

添加自定义数字签名功能

页: [1] 2
查看完整版本: Python PyInstaller 高级打包工具