[](https://pypi.org/project/soeasypack)
[](https://pepy.tech/projects/soeasypack)
# SoEasyPack
- 此项目受[PyStand](https://github.com/skywind3000/PyStand "PyStand")和[PythonSizeCruncher](https://github.com/mengdeer589/PythonSizeCruncher "PythonSizeCruncher")启发。
- 不需要复制嵌入式包,也不必再二次瘦身,一次打包理论上就是最小依赖文件数
- 用简易的方式复制你的python项目并自动精准匹配环境依赖,几乎没有什么多余文件,
并且可以生成一个exe启动器启动项目。(用go语言编译,已内置简化过的go环境)
- 快速/普通模式原理:使用微软[procmon](https://learn.microsoft.com/en-us/sysinternals/downloads/procmon "procmon")进程监控工具(已内置),监控项目运行时访问的文件记录
- 仅支持windows,且仅在windows10和11上测试过
## 虚拟环境打包大小对比
| 打包工具 | 打包后大小 |
|-----------------------------|-------|
| nuitka 2.5.9打包 | 67.9M |
| PyStand仅删除pip文件夹 | 56.9M |
| Pyinstaller 6.11.1打包缺依赖 补上后 | 49.3M |
| soeasypack的ast模式打包 | 43.7M |
| soeasypack的快速模式打包 | 33.5M |
| soeasypack的普通模式打包 | 33.5M |
| soeasypack的单exe模式打包 | 16.3M |
| 使用soeasypack的to_slim_file瘦身 | 原体积大小 | 瘦身后大小 | 瘦身比例 |
|---------------------------------|-------|------------|--------|
| 对PyStand打包的项目瘦身 | 56.9M | 36.5M | 35.79% |
| 对nuitka打包的项目瘦身 | 67.9M | 54.8M | 19.37% |
| 对Pyinstaller打包的项目瘦身 | 49.3M | 36.6M | 25.52% |
## 安装
soeasypack is available on PyPI. You can install it through pip:
```shell
pip install soeasypack
```
## 操作演示
[点击查看操作演示](https://b23.tv/2UH6YO3 "操作演示")
## 介绍
- **1**: 模式介绍
- 项目有四种打包模式:【普通打包】【快速打包】【伪轻量打包】【ast模式打包】(默认使用快速打包).
- pack_mode:0/快速打包模式 ,1/普通打包模式, 2/伪轻量打包模式, 3/ast模式打包
- 普通打包会先复制当前python主环境的必要官方文件,然后复制当前py环境的整个site-packages
文件夹到你指定的保存目录,然后启动分析工具分析依赖文件,然后根据依赖文件去删除rundep文件夹
中无用的文件,会保留被删除的文件到removed_file中,然后自动生成exe, 还可选将你的脚本文件转为pyd,
最后项目就打包完成了。因为会复制整个site-packages文件夹,所以普通模式只建议在虚拟环境中使用。
- 快速打包是先启动分析工具分析依赖文件。然后把依赖文件复制到保存目录,再自动生成exe, 没有项目瘦身这一步骤,
所以没有虚拟环境的话,建议使用快速打包模式,它不会复制整个site-packages文件夹
- 伪轻量打包是复制当前python主环境除了site-packages文件夹之外的必要官方文件,然后复制用户脚本目录,复制requirements.txt,
用户启动程序后检查依赖是否缺失,缺失自动pip下载,下载完成后rundep目录生成compiled_pip.txt,用以下次启动判断是否需要下载依赖项,
建议requirements.txt使用pipreqs包生成
- **2**: 嵌入exe介绍
- 普通嵌入exe:设置embed_exe=True,会把rundep/AppData文件夹下用户的所有.py文件转换为.pyc,然后嵌入exe中,其它类型和其它文件夹不会嵌入。
- 单exe文件:设置onefile=True,会把rundep/AppData文件夹下用户的所有.py文件转换为.pyc,然后嵌入exe中,
然后把rundep文件下所有文件压缩成一个zip压缩包嵌入exe中,exe运行时会解压缩到临时目录,退出程序则删除临时目录.
其它制作单exe文件方法:使用[Enigma Virtual Box](https://www.enigmaprotector.com/cn/downloads.html)工具打包成只有一个exe
- **3**: 函数介绍
- 1.打包项目
```python
from soeasypack import to_pack
save_dir = r'C:\save_dir'
main_py_path = r'C:\my_project\main.py'
exe_name = '大都督'
to_pack(main_py_path, save_dir, pack_mode=0, embed_exe=False,exe_name=exe_name,
pyc_optimize=1, except_packages=['numpy'])
```
- 2.项目瘦身
```python
from soeasypack import to_slim_file
to_slim_file(main_run_path: str, check_dir: str, project_dir: str = None, monitoring_time=20)
```
- 3.生成pyd
```python
from soeasypack import to_pyd
to_pyd(script_dir: str, script_dir_main_py: str, is_del_py: bool = False)
```
## 注意事项
- 因360安全卫士会拦截procmon相关工具, 所以,打包前请先关闭360安全卫士或放行。
- 以管理员身份运行打包代码,或在以管理员身份打开的编辑器中运行程序可避免每次启动procmon时弹出用户账户控制确认窗口,
以管理员身份运行用户程序,拖放文件到窗口功能会失效
- 默认会将大全部.py文件转为.pyc.不保留原.py文件,优化级别默认使用为1。
- 会自动将主py文件重命名为main, exe启动时会将工作目录切换至rundep/Appdata,会依次寻找文件夹下mian.pyc,.py,.pyd启动文件
- 建议在虚拟环境中使用,非虚拟环境可能会打包无用的依赖(非虚拟环境测试项目:未使用numpy,但项目运行时不知为何访问了numpy,导致复制了这个无用的包)
- 为了能完整记录依赖文件,监控工具启动后,会自动运行你的脚本,请对你的项目进行必要的操作:如点击运行按钮等,
如:我使用openpyxl往表格中插入图片,项目自动启动后,我要让脚本执行这一操作,
这样,监控工具才能监控到依赖文件,否则最后虽然能启动项目但是插入图片时会报错,
所以,请一定要注意,你的项目启动后,一定要默认监控时间18秒内执行必要的操作。
18秒大概会产生几百兆的日志,所以,监控时间可以根据实际情况调整。
- 因.pyc可能会被反编译,建议使用soeasypack的py文件转pyd函数(好像需要先安装Visual Studio, 我自己之前安装的有,其它情况也没试)或使用嵌入exe功能
- 伪轻量打包会自动将AppData文件夹下全部.py文件转为.pyc,然后嵌入exe
- 程序图标需要使用png格式
- 若启动出错无法查看报错信息可设置hide_cmd=False,编译成带控制台的exe,然后在cmd中去启动程序查看报错信息
- 多进程需要添加冻结指令
```python
import sys
from multiprocessing import freeze_support
if __name__ == '__main__':
# 冻结支持,确保在打包后的环境中正确启动新的Python解释器进程
sys.frozen = True
freeze_support()
```
- 如果你觉得对你有帮助的话,可以打赏1元让作者买个馍呀

Raw data
{
"_id": null,
"home_page": "https://github.com/XMQSVIP/SoEasyPack",
"name": "soeasypack",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "soeasypack, packaging, pyinstaller, py2exe, cxfreeze",
"author": "xmqsvip",
"author_email": "xmqsvip@qq.com",
"download_url": "https://files.pythonhosted.org/packages/f4/8f/84b18c0032e987948da32d828c56e19470d1a213232c4b86da473047a122/soeasypack-0.9.8.tar.gz",
"platform": null,
"description": "[](https://pypi.org/project/soeasypack)\n[](https://pepy.tech/projects/soeasypack)\n# SoEasyPack\n- \u6b64\u9879\u76ee\u53d7[PyStand](https://github.com/skywind3000/PyStand \"PyStand\")\u548c[PythonSizeCruncher](https://github.com/mengdeer589/PythonSizeCruncher \"PythonSizeCruncher\")\u542f\u53d1\u3002\n- \u4e0d\u9700\u8981\u590d\u5236\u5d4c\u5165\u5f0f\u5305\uff0c\u4e5f\u4e0d\u5fc5\u518d\u4e8c\u6b21\u7626\u8eab,\u4e00\u6b21\u6253\u5305\u7406\u8bba\u4e0a\u5c31\u662f\u6700\u5c0f\u4f9d\u8d56\u6587\u4ef6\u6570\n- \u7528\u7b80\u6613\u7684\u65b9\u5f0f\u590d\u5236\u4f60\u7684python\u9879\u76ee\u5e76\u81ea\u52a8\u7cbe\u51c6\u5339\u914d\u73af\u5883\u4f9d\u8d56\uff0c\u51e0\u4e4e\u6ca1\u6709\u4ec0\u4e48\u591a\u4f59\u6587\u4ef6\uff0c\n \u5e76\u4e14\u53ef\u4ee5\u751f\u6210\u4e00\u4e2aexe\u542f\u52a8\u5668\u542f\u52a8\u9879\u76ee\u3002\uff08\u7528go\u8bed\u8a00\u7f16\u8bd1,\u5df2\u5185\u7f6e\u7b80\u5316\u8fc7\u7684go\u73af\u5883\uff09\n- \u5feb\u901f/\u666e\u901a\u6a21\u5f0f\u539f\u7406\uff1a\u4f7f\u7528\u5fae\u8f6f[procmon](https://learn.microsoft.com/en-us/sysinternals/downloads/procmon \"procmon\")\u8fdb\u7a0b\u76d1\u63a7\u5de5\u5177\uff08\u5df2\u5185\u7f6e\uff09\uff0c\u76d1\u63a7\u9879\u76ee\u8fd0\u884c\u65f6\u8bbf\u95ee\u7684\u6587\u4ef6\u8bb0\u5f55\n- \u4ec5\u652f\u6301windows\uff0c\u4e14\u4ec5\u5728windows10\u548c11\u4e0a\u6d4b\u8bd5\u8fc7\n## \u865a\u62df\u73af\u5883\u6253\u5305\u5927\u5c0f\u5bf9\u6bd4\n| \u6253\u5305\u5de5\u5177 | \u6253\u5305\u540e\u5927\u5c0f |\n|-----------------------------|-------|\n| nuitka 2.5.9\u6253\u5305 | 67.9M |\n| PyStand\u4ec5\u5220\u9664pip\u6587\u4ef6\u5939 | 56.9M |\n| Pyinstaller 6.11.1\u6253\u5305\u7f3a\u4f9d\u8d56 \u8865\u4e0a\u540e | 49.3M |\n| soeasypack\u7684ast\u6a21\u5f0f\u6253\u5305 | 43.7M |\n| soeasypack\u7684\u5feb\u901f\u6a21\u5f0f\u6253\u5305 | 33.5M |\n| soeasypack\u7684\u666e\u901a\u6a21\u5f0f\u6253\u5305 | 33.5M |\n| soeasypack\u7684\u5355exe\u6a21\u5f0f\u6253\u5305 | 16.3M |\n\n| \u4f7f\u7528soeasypack\u7684to_slim_file\u7626\u8eab | \u539f\u4f53\u79ef\u5927\u5c0f | \u7626\u8eab\u540e\u5927\u5c0f | \u7626\u8eab\u6bd4\u4f8b |\n|---------------------------------|-------|------------|--------|\n| \u5bf9PyStand\u6253\u5305\u7684\u9879\u76ee\u7626\u8eab | 56.9M | 36.5M | 35.79% |\n| \u5bf9nuitka\u6253\u5305\u7684\u9879\u76ee\u7626\u8eab | 67.9M | 54.8M | 19.37% |\n| \u5bf9Pyinstaller\u6253\u5305\u7684\u9879\u76ee\u7626\u8eab | 49.3M | 36.6M | 25.52% |\n\n## \u5b89\u88c5\n\nsoeasypack is available on PyPI. You can install it through pip:\n\n\n```shell\n pip install soeasypack\n```\n## \u64cd\u4f5c\u6f14\u793a\n [\u70b9\u51fb\u67e5\u770b\u64cd\u4f5c\u6f14\u793a](https://b23.tv/2UH6YO3 \"\u64cd\u4f5c\u6f14\u793a\") \n## \u4ecb\u7ecd\n\n- **1**: \u6a21\u5f0f\u4ecb\u7ecd\n- \u9879\u76ee\u6709\u56db\u79cd\u6253\u5305\u6a21\u5f0f\uff1a\u3010\u666e\u901a\u6253\u5305\u3011\u3010\u5feb\u901f\u6253\u5305\u3011\u3010\u4f2a\u8f7b\u91cf\u6253\u5305\u3011\u3010ast\u6a21\u5f0f\u6253\u5305\u3011\uff08\u9ed8\u8ba4\u4f7f\u7528\u5feb\u901f\u6253\u5305\uff09.\n- pack_mode\uff1a0/\u5feb\u901f\u6253\u5305\u6a21\u5f0f \uff0c1/\u666e\u901a\u6253\u5305\u6a21\u5f0f\uff0c 2/\u4f2a\u8f7b\u91cf\u6253\u5305\u6a21\u5f0f\uff0c 3/ast\u6a21\u5f0f\u6253\u5305\n\n- \u666e\u901a\u6253\u5305\u4f1a\u5148\u590d\u5236\u5f53\u524dpython\u4e3b\u73af\u5883\u7684\u5fc5\u8981\u5b98\u65b9\u6587\u4ef6\uff0c\u7136\u540e\u590d\u5236\u5f53\u524dpy\u73af\u5883\u7684\u6574\u4e2asite-packages\n\u6587\u4ef6\u5939\u5230\u4f60\u6307\u5b9a\u7684\u4fdd\u5b58\u76ee\u5f55\uff0c\u7136\u540e\u542f\u52a8\u5206\u6790\u5de5\u5177\u5206\u6790\u4f9d\u8d56\u6587\u4ef6\uff0c\u7136\u540e\u6839\u636e\u4f9d\u8d56\u6587\u4ef6\u53bb\u5220\u9664rundep\u6587\u4ef6\u5939\n\u4e2d\u65e0\u7528\u7684\u6587\u4ef6\uff0c\u4f1a\u4fdd\u7559\u88ab\u5220\u9664\u7684\u6587\u4ef6\u5230removed_file\u4e2d\uff0c\u7136\u540e\u81ea\u52a8\u751f\u6210exe, \u8fd8\u53ef\u9009\u5c06\u4f60\u7684\u811a\u672c\u6587\u4ef6\u8f6c\u4e3apyd,\n\u6700\u540e\u9879\u76ee\u5c31\u6253\u5305\u5b8c\u6210\u4e86\u3002\u56e0\u4e3a\u4f1a\u590d\u5236\u6574\u4e2asite-packages\u6587\u4ef6\u5939\uff0c\u6240\u4ee5\u666e\u901a\u6a21\u5f0f\u53ea\u5efa\u8bae\u5728\u865a\u62df\u73af\u5883\u4e2d\u4f7f\u7528\u3002\n \n- \u5feb\u901f\u6253\u5305\u662f\u5148\u542f\u52a8\u5206\u6790\u5de5\u5177\u5206\u6790\u4f9d\u8d56\u6587\u4ef6\u3002\u7136\u540e\u628a\u4f9d\u8d56\u6587\u4ef6\u590d\u5236\u5230\u4fdd\u5b58\u76ee\u5f55\uff0c\u518d\u81ea\u52a8\u751f\u6210exe, \u6ca1\u6709\u9879\u76ee\u7626\u8eab\u8fd9\u4e00\u6b65\u9aa4\uff0c\n\u6240\u4ee5\u6ca1\u6709\u865a\u62df\u73af\u5883\u7684\u8bdd\uff0c\u5efa\u8bae\u4f7f\u7528\u5feb\u901f\u6253\u5305\u6a21\u5f0f\uff0c\u5b83\u4e0d\u4f1a\u590d\u5236\u6574\u4e2asite-packages\u6587\u4ef6\u5939\n\n- \u4f2a\u8f7b\u91cf\u6253\u5305\u662f\u590d\u5236\u5f53\u524dpython\u4e3b\u73af\u5883\u9664\u4e86site-packages\u6587\u4ef6\u5939\u4e4b\u5916\u7684\u5fc5\u8981\u5b98\u65b9\u6587\u4ef6\uff0c\u7136\u540e\u590d\u5236\u7528\u6237\u811a\u672c\u76ee\u5f55\uff0c\u590d\u5236requirements.txt,\n\u7528\u6237\u542f\u52a8\u7a0b\u5e8f\u540e\u68c0\u67e5\u4f9d\u8d56\u662f\u5426\u7f3a\u5931\uff0c\u7f3a\u5931\u81ea\u52a8pip\u4e0b\u8f7d,\u4e0b\u8f7d\u5b8c\u6210\u540erundep\u76ee\u5f55\u751f\u6210compiled_pip.txt\uff0c\u7528\u4ee5\u4e0b\u6b21\u542f\u52a8\u5224\u65ad\u662f\u5426\u9700\u8981\u4e0b\u8f7d\u4f9d\u8d56\u9879\uff0c\n\u5efa\u8baerequirements.txt\u4f7f\u7528pipreqs\u5305\u751f\u6210\n\n- **2**: \u5d4c\u5165exe\u4ecb\u7ecd\n- \u666e\u901a\u5d4c\u5165exe\uff1a\u8bbe\u7f6eembed_exe=True,\u4f1a\u628arundep/AppData\u6587\u4ef6\u5939\u4e0b\u7528\u6237\u7684\u6240\u6709.py\u6587\u4ef6\u8f6c\u6362\u4e3a.pyc\uff0c\u7136\u540e\u5d4c\u5165exe\u4e2d\uff0c\u5176\u5b83\u7c7b\u578b\u548c\u5176\u5b83\u6587\u4ef6\u5939\u4e0d\u4f1a\u5d4c\u5165\u3002\n- \u5355exe\u6587\u4ef6\uff1a\u8bbe\u7f6eonefile=True,\u4f1a\u628arundep/AppData\u6587\u4ef6\u5939\u4e0b\u7528\u6237\u7684\u6240\u6709.py\u6587\u4ef6\u8f6c\u6362\u4e3a.pyc\uff0c\u7136\u540e\u5d4c\u5165exe\u4e2d\uff0c\n\u7136\u540e\u628arundep\u6587\u4ef6\u4e0b\u6240\u6709\u6587\u4ef6\u538b\u7f29\u6210\u4e00\u4e2azip\u538b\u7f29\u5305\u5d4c\u5165exe\u4e2d\uff0cexe\u8fd0\u884c\u65f6\u4f1a\u89e3\u538b\u7f29\u5230\u4e34\u65f6\u76ee\u5f55\uff0c\u9000\u51fa\u7a0b\u5e8f\u5219\u5220\u9664\u4e34\u65f6\u76ee\u5f55.\n\u5176\u5b83\u5236\u4f5c\u5355exe\u6587\u4ef6\u65b9\u6cd5\uff1a\u4f7f\u7528[Enigma Virtual Box](https://www.enigmaprotector.com/cn/downloads.html)\u5de5\u5177\u6253\u5305\u6210\u53ea\u6709\u4e00\u4e2aexe \n- **3**: \u51fd\u6570\u4ecb\u7ecd\n - 1.\u6253\u5305\u9879\u76ee\n ```python\n from soeasypack import to_pack\n \n save_dir = r'C:\\save_dir'\n main_py_path = r'C:\\my_project\\main.py' \n exe_name = '\u5927\u90fd\u7763'\n to_pack(main_py_path, save_dir, pack_mode=0, embed_exe=False,exe_name=exe_name, \n pyc_optimize=1, except_packages=['numpy']) \n ```\n - 2.\u9879\u76ee\u7626\u8eab\n ```python\n from soeasypack import to_slim_file\n to_slim_file(main_run_path: str, check_dir: str, project_dir: str = None, monitoring_time=20)\n ```\n - 3.\u751f\u6210pyd\n ```python\n from soeasypack import to_pyd\n to_pyd(script_dir: str, script_dir_main_py: str, is_del_py: bool = False)\n ```\n## \u6ce8\u610f\u4e8b\u9879\n- \u56e0360\u5b89\u5168\u536b\u58eb\u4f1a\u62e6\u622aprocmon\u76f8\u5173\u5de5\u5177, \u6240\u4ee5\uff0c\u6253\u5305\u524d\u8bf7\u5148\u5173\u95ed360\u5b89\u5168\u536b\u58eb\u6216\u653e\u884c\u3002\n- \u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u8fd0\u884c\u6253\u5305\u4ee3\u7801\uff0c\u6216\u5728\u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u6253\u5f00\u7684\u7f16\u8f91\u5668\u4e2d\u8fd0\u884c\u7a0b\u5e8f\u53ef\u907f\u514d\u6bcf\u6b21\u542f\u52a8procmon\u65f6\u5f39\u51fa\u7528\u6237\u8d26\u6237\u63a7\u5236\u786e\u8ba4\u7a97\u53e3\uff0c\n\u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u8fd0\u884c\u7528\u6237\u7a0b\u5e8f\uff0c\u62d6\u653e\u6587\u4ef6\u5230\u7a97\u53e3\u529f\u80fd\u4f1a\u5931\u6548\n- \u9ed8\u8ba4\u4f1a\u5c06\u5927\u5168\u90e8.py\u6587\u4ef6\u8f6c\u4e3a.pyc.\u4e0d\u4fdd\u7559\u539f.py\u6587\u4ef6\uff0c\u4f18\u5316\u7ea7\u522b\u9ed8\u8ba4\u4f7f\u7528\u4e3a1\u3002\n- \u4f1a\u81ea\u52a8\u5c06\u4e3bpy\u6587\u4ef6\u91cd\u547d\u540d\u4e3amain, exe\u542f\u52a8\u65f6\u4f1a\u5c06\u5de5\u4f5c\u76ee\u5f55\u5207\u6362\u81f3rundep/Appdata,\u4f1a\u4f9d\u6b21\u5bfb\u627e\u6587\u4ef6\u5939\u4e0bmian.pyc,.py,.pyd\u542f\u52a8\u6587\u4ef6\n- \u5efa\u8bae\u5728\u865a\u62df\u73af\u5883\u4e2d\u4f7f\u7528\uff0c\u975e\u865a\u62df\u73af\u5883\u53ef\u80fd\u4f1a\u6253\u5305\u65e0\u7528\u7684\u4f9d\u8d56(\u975e\u865a\u62df\u73af\u5883\u6d4b\u8bd5\u9879\u76ee\uff1a\u672a\u4f7f\u7528numpy,\u4f46\u9879\u76ee\u8fd0\u884c\u65f6\u4e0d\u77e5\u4e3a\u4f55\u8bbf\u95ee\u4e86numpy,\u5bfc\u81f4\u590d\u5236\u4e86\u8fd9\u4e2a\u65e0\u7528\u7684\u5305)\n- \u4e3a\u4e86\u80fd\u5b8c\u6574\u8bb0\u5f55\u4f9d\u8d56\u6587\u4ef6\uff0c\u76d1\u63a7\u5de5\u5177\u542f\u52a8\u540e\uff0c\u4f1a\u81ea\u52a8\u8fd0\u884c\u4f60\u7684\u811a\u672c\uff0c\u8bf7\u5bf9\u4f60\u7684\u9879\u76ee\u8fdb\u884c\u5fc5\u8981\u7684\u64cd\u4f5c\uff1a\u5982\u70b9\u51fb\u8fd0\u884c\u6309\u94ae\u7b49\uff0c\n \u5982\uff1a\u6211\u4f7f\u7528openpyxl\u5f80\u8868\u683c\u4e2d\u63d2\u5165\u56fe\u7247\uff0c\u9879\u76ee\u81ea\u52a8\u542f\u52a8\u540e\uff0c\u6211\u8981\u8ba9\u811a\u672c\u6267\u884c\u8fd9\u4e00\u64cd\u4f5c\uff0c\n \u8fd9\u6837\uff0c\u76d1\u63a7\u5de5\u5177\u624d\u80fd\u76d1\u63a7\u5230\u4f9d\u8d56\u6587\u4ef6\uff0c\u5426\u5219\u6700\u540e\u867d\u7136\u80fd\u542f\u52a8\u9879\u76ee\u4f46\u662f\u63d2\u5165\u56fe\u7247\u65f6\u4f1a\u62a5\u9519\uff0c\n \u6240\u4ee5\uff0c\u8bf7\u4e00\u5b9a\u8981\u6ce8\u610f\uff0c\u4f60\u7684\u9879\u76ee\u542f\u52a8\u540e\uff0c\u4e00\u5b9a\u8981\u9ed8\u8ba4\u76d1\u63a7\u65f6\u95f418\u79d2\u5185\u6267\u884c\u5fc5\u8981\u7684\u64cd\u4f5c\u3002\n 18\u79d2\u5927\u6982\u4f1a\u4ea7\u751f\u51e0\u767e\u5146\u7684\u65e5\u5fd7\uff0c\u6240\u4ee5\uff0c\u76d1\u63a7\u65f6\u95f4\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u8c03\u6574\u3002\n- \u56e0.pyc\u53ef\u80fd\u4f1a\u88ab\u53cd\u7f16\u8bd1\uff0c\u5efa\u8bae\u4f7f\u7528soeasypack\u7684py\u6587\u4ef6\u8f6cpyd\u51fd\u6570\uff08\u597d\u50cf\u9700\u8981\u5148\u5b89\u88c5Visual Studio, \u6211\u81ea\u5df1\u4e4b\u524d\u5b89\u88c5\u7684\u6709\uff0c\u5176\u5b83\u60c5\u51b5\u4e5f\u6ca1\u8bd5\uff09\u6216\u4f7f\u7528\u5d4c\u5165exe\u529f\u80fd\n- \u4f2a\u8f7b\u91cf\u6253\u5305\u4f1a\u81ea\u52a8\u5c06AppData\u6587\u4ef6\u5939\u4e0b\u5168\u90e8.py\u6587\u4ef6\u8f6c\u4e3a.pyc\uff0c\u7136\u540e\u5d4c\u5165exe\n- \u7a0b\u5e8f\u56fe\u6807\u9700\u8981\u4f7f\u7528png\u683c\u5f0f\n- \u82e5\u542f\u52a8\u51fa\u9519\u65e0\u6cd5\u67e5\u770b\u62a5\u9519\u4fe1\u606f\u53ef\u8bbe\u7f6ehide_cmd=False,\u7f16\u8bd1\u6210\u5e26\u63a7\u5236\u53f0\u7684exe\uff0c\u7136\u540e\u5728cmd\u4e2d\u53bb\u542f\u52a8\u7a0b\u5e8f\u67e5\u770b\u62a5\u9519\u4fe1\u606f\n- \u591a\u8fdb\u7a0b\u9700\u8981\u6dfb\u52a0\u51bb\u7ed3\u6307\u4ee4\n```python\nimport sys\nfrom multiprocessing import freeze_support\nif __name__ == '__main__':\n # \u51bb\u7ed3\u652f\u6301\uff0c\u786e\u4fdd\u5728\u6253\u5305\u540e\u7684\u73af\u5883\u4e2d\u6b63\u786e\u542f\u52a8\u65b0\u7684Python\u89e3\u91ca\u5668\u8fdb\u7a0b\n sys.frozen = True\n freeze_support()\n```\n\n\n- \u5982\u679c\u4f60\u89c9\u5f97\u5bf9\u4f60\u6709\u5e2e\u52a9\u7684\u8bdd\uff0c\u53ef\u4ee5\u6253\u8d4f1\u5143\u8ba9\u4f5c\u8005\u4e70\u4e2a\u998d\u5440\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "\u7b80\u6613\u7cbe\u51c6\u6253\u5305python\u9879\u76ee\u548c\u4f9d\u8d56\u73af\u5883 Easy and precise packaging of python projects and dependencies",
"version": "0.9.8",
"project_urls": {
"Homepage": "https://github.com/XMQSVIP/SoEasyPack"
},
"split_keywords": [
"soeasypack",
" packaging",
" pyinstaller",
" py2exe",
" cxfreeze"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f48f84b18c0032e987948da32d828c56e19470d1a213232c4b86da473047a122",
"md5": "6db8553de2193e94f2e84e77b6ec44a0",
"sha256": "60bc0256b0957ac89e9d6208d13d715acb4c41ea35499c0ab7190652efced8c0"
},
"downloads": -1,
"filename": "soeasypack-0.9.8.tar.gz",
"has_sig": false,
"md5_digest": "6db8553de2193e94f2e84e77b6ec44a0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 30030955,
"upload_time": "2025-01-11T15:47:38",
"upload_time_iso_8601": "2025-01-11T15:47:38.460694Z",
"url": "https://files.pythonhosted.org/packages/f4/8f/84b18c0032e987948da32d828c56e19470d1a213232c4b86da473047a122/soeasypack-0.9.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-11 15:47:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "XMQSVIP",
"github_project": "SoEasyPack",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "soeasypack"
}