wings-easy


Namewings-easy JSON
Version 0.6 PyPI version JSON
download
home_pagehttps://github.com/5hmlA/PyTools
Summarypython library for easier develop
upload_time2025-07-09 13:56:01
maintainerNone
docs_urlNone
author5hmlA
requires_python>=3.6
licenseMIT Licence
keywords easy helpers
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## PyCharm 自动生成 requirements.txt

> 使用Python打开自己的工程,然后点击Tools,最后点击Sync Python Requirements
>
> **pip install -r requirements.txt** 

### 其他注意事项:

 - 确保 requirements.txt 文件位于项目的根目录。
 - 在提交代码到版本控制系统之前,更新 requirements.txt 文件。
 - 在使用 pip install -r requirements.txt 安装依赖项时,确保使用与项目环境匹配的 Python 版本。

# 打包执行以下命令

### **```pyinstaller -n [your_exe_name] -F -w -i [your_ico] [your_main].py```** 

会根据打包指定的py文件解析所有依赖自动打包所有依赖文件,并生成一个可执行文件。
>--hidden-import 设置导入要动态加载的类 因为没被引用 所以不会导入需要手动设置
>
>上述命令中的选项说明:
>
>-n NAME, --name NAME: 可执行文件名称。
>
>-F, --onefile: 将整个项目打包为一个单独的可执行文件。
>
>-w, --windowed, --noconsole: 隐藏控制台窗口,将打包的应用程序显示为GUI应用程序。
>
>--add-data: 添加项目资源,支持文件夹和文件,前面是资源路径,后面是输出路径,用分号进行分割。
>
>-i <FILE.ico>, --icon <FILE.ico> :  指定icon
>
>执行上述命令后,会在项目目录下生成一个.spec文件,这个文件会告诉PyInstaller如何将项目打包成exe文件。

# 打包报错排查

- ### <span style="color: red;">无法将“pyinstaller”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。</span>

  > 解决方案: 安装 PyInstaller
  >
  > pip install PyInstaller
  >
  > pyinstaller --name=<your_exe_name> --onefile --windowed --add-data "<your_data_folder>;<your_data_folder>" <your_script_name>.py


- ### <span style="color: red;">win32ctypes.pywin32.pywintypes.error: (225, 'EndUpdateResourceW', '无法成功完成操作,因为文件包含病毒或潜在的垃圾软件。</span>

  > 不使用-w --noconsole的命令打包隐藏命令行窗口时,是正常的,
  >
  > 但是使用-w或者--noconsole就会报错win32ctypes.pywin32.pywintypes.error: (225, '', '无法成功完成操作,因为文件包含病毒或潜在的垃圾软件。')
  >
  > 解决方案: 降级 PyInstaller, 安装6.2.0重新打包即可
  > 
  > pip install pyinstaller==6.2.0

>

## 生成requirement

> pip freeze > requirements.txt
>

## 打包

> pyinstaller -n [your_exe_name] -F -w -i [your_ico] [your_main].py
> pyinstaller --onefile --add-data "[your_folder]/*.py;[your_folder]" [your_main].py
> pyinstaller --onefile --add-data "[your_folder];[your_folder]" [your_main].py
> pyinstaller --onefile --hidden-import=[your_module] [your_main].py

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/5hmlA/PyTools",
    "name": "wings-easy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "easy, helpers",
    "author": "5hmlA",
    "author_email": "gene.jzy@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/28/23/8cf1dd7a783f9b538c34c4033e7c27bb3fba5ce2de09bf4c8188340f330f/wings_easy-0.6.tar.gz",
    "platform": null,
    "description": "## PyCharm \u81ea\u52a8\u751f\u6210 requirements.txt\n\n> \u4f7f\u7528Python\u6253\u5f00\u81ea\u5df1\u7684\u5de5\u7a0b\uff0c\u7136\u540e\u70b9\u51fbTools\uff0c\u6700\u540e\u70b9\u51fbSync Python Requirements\n>\n> **pip install -r requirements.txt** \n\n### \u5176\u4ed6\u6ce8\u610f\u4e8b\u9879\uff1a\n\n - \u786e\u4fdd requirements.txt \u6587\u4ef6\u4f4d\u4e8e\u9879\u76ee\u7684\u6839\u76ee\u5f55\u3002\n - \u5728\u63d0\u4ea4\u4ee3\u7801\u5230\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u4e4b\u524d\uff0c\u66f4\u65b0 requirements.txt \u6587\u4ef6\u3002\n - \u5728\u4f7f\u7528 pip install -r requirements.txt \u5b89\u88c5\u4f9d\u8d56\u9879\u65f6\uff0c\u786e\u4fdd\u4f7f\u7528\u4e0e\u9879\u76ee\u73af\u5883\u5339\u914d\u7684 Python \u7248\u672c\u3002\n\n# \u6253\u5305\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\n\n### **```pyinstaller -n [your_exe_name] -F -w -i [your_ico] [your_main].py```** \n\n\u4f1a\u6839\u636e\u6253\u5305\u6307\u5b9a\u7684py\u6587\u4ef6\u89e3\u6790\u6240\u6709\u4f9d\u8d56\u81ea\u52a8\u6253\u5305\u6240\u6709\u4f9d\u8d56\u6587\u4ef6\uff0c\u5e76\u751f\u6210\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\u3002\n>--hidden-import \u8bbe\u7f6e\u5bfc\u5165\u8981\u52a8\u6001\u52a0\u8f7d\u7684\u7c7b \u56e0\u4e3a\u6ca1\u88ab\u5f15\u7528 \u6240\u4ee5\u4e0d\u4f1a\u5bfc\u5165\u9700\u8981\u624b\u52a8\u8bbe\u7f6e\n>\n>\u4e0a\u8ff0\u547d\u4ee4\u4e2d\u7684\u9009\u9879\u8bf4\u660e\uff1a\n>\n>-n NAME, --name NAME: \u53ef\u6267\u884c\u6587\u4ef6\u540d\u79f0\u3002\n>\n>-F, --onefile: \u5c06\u6574\u4e2a\u9879\u76ee\u6253\u5305\u4e3a\u4e00\u4e2a\u5355\u72ec\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002\n>\n>-w, --windowed, --noconsole: \u9690\u85cf\u63a7\u5236\u53f0\u7a97\u53e3\uff0c\u5c06\u6253\u5305\u7684\u5e94\u7528\u7a0b\u5e8f\u663e\u793a\u4e3aGUI\u5e94\u7528\u7a0b\u5e8f\u3002\n>\n>--add-data: \u6dfb\u52a0\u9879\u76ee\u8d44\u6e90\uff0c\u652f\u6301\u6587\u4ef6\u5939\u548c\u6587\u4ef6\uff0c\u524d\u9762\u662f\u8d44\u6e90\u8def\u5f84\uff0c\u540e\u9762\u662f\u8f93\u51fa\u8def\u5f84\uff0c\u7528\u5206\u53f7\u8fdb\u884c\u5206\u5272\u3002\n>\n>-i <FILE.ico>, --icon <FILE.ico> :  \u6307\u5b9aicon\n>\n>\u6267\u884c\u4e0a\u8ff0\u547d\u4ee4\u540e\uff0c\u4f1a\u5728\u9879\u76ee\u76ee\u5f55\u4e0b\u751f\u6210\u4e00\u4e2a.spec\u6587\u4ef6\uff0c\u8fd9\u4e2a\u6587\u4ef6\u4f1a\u544a\u8bc9PyInstaller\u5982\u4f55\u5c06\u9879\u76ee\u6253\u5305\u6210exe\u6587\u4ef6\u3002\n\n# \u6253\u5305\u62a5\u9519\u6392\u67e5\n\n- ### <span style=\"color: red;\">\u65e0\u6cd5\u5c06\u201cpyinstaller\u201d\u9879\u8bc6\u522b\u4e3a cmdlet\u3001\u51fd\u6570\u3001\u811a\u672c\u6587\u4ef6\u6216\u53ef\u8fd0\u884c\u7a0b\u5e8f\u7684\u540d\u79f0\u3002\u8bf7\u68c0\u67e5\u540d\u79f0\u7684\u62fc\u5199\uff0c\u5982\u679c\u5305\u62ec\u8def\u5f84\uff0c\u8bf7\u786e\u4fdd\u8def\u5f84\u6b63\u786e\uff0c\u7136\u540e\u518d\u8bd5\u4e00\u6b21\u3002</span>\n\n  > \u89e3\u51b3\u65b9\u6848: \u5b89\u88c5 PyInstaller\n  >\n  > pip install PyInstaller\n  >\n  > pyinstaller --name=<your_exe_name> --onefile --windowed --add-data \"<your_data_folder>;<your_data_folder>\" <your_script_name>.py\n\n\n- ### <span style=\"color: red;\">win32ctypes.pywin32.pywintypes.error: (225, 'EndUpdateResourceW', '\u65e0\u6cd5\u6210\u529f\u5b8c\u6210\u64cd\u4f5c\uff0c\u56e0\u4e3a\u6587\u4ef6\u5305\u542b\u75c5\u6bd2\u6216\u6f5c\u5728\u7684\u5783\u573e\u8f6f\u4ef6\u3002</span>\n\n  > \u4e0d\u4f7f\u7528-w --noconsole\u7684\u547d\u4ee4\u6253\u5305\u9690\u85cf\u547d\u4ee4\u884c\u7a97\u53e3\u65f6\uff0c\u662f\u6b63\u5e38\u7684\uff0c\n  >\n  > \u4f46\u662f\u4f7f\u7528-w\u6216\u8005--noconsole\u5c31\u4f1a\u62a5\u9519win32ctypes.pywin32.pywintypes.error: (225, '', '\u65e0\u6cd5\u6210\u529f\u5b8c\u6210\u64cd\u4f5c\uff0c\u56e0\u4e3a\u6587\u4ef6\u5305\u542b\u75c5\u6bd2\u6216\u6f5c\u5728\u7684\u5783\u573e\u8f6f\u4ef6\u3002')\n  >\n  > \u89e3\u51b3\u65b9\u6848: \u964d\u7ea7 PyInstaller, \u5b89\u88c56.2.0\u91cd\u65b0\u6253\u5305\u5373\u53ef\n  > \n  > pip install pyinstaller==6.2.0\n\n>\n\n## \u751f\u6210requirement\n\n> pip freeze > requirements.txt\n>\n\n## \u6253\u5305\n\n> pyinstaller -n [your_exe_name] -F -w -i [your_ico] [your_main].py\n> pyinstaller --onefile --add-data \"[your_folder]/*.py;[your_folder]\" [your_main].py\n> pyinstaller --onefile --add-data \"[your_folder];[your_folder]\" [your_main].py\n> pyinstaller --onefile --hidden-import=[your_module] [your_main].py\n",
    "bugtrack_url": null,
    "license": "MIT Licence",
    "summary": "python library for easier develop",
    "version": "0.6",
    "project_urls": {
        "Homepage": "https://github.com/5hmlA/PyTools"
    },
    "split_keywords": [
        "easy",
        " helpers"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4aecfef6356eaacc96472a770ff3084e5fb42960940f59f19031108d1bcbaa07",
                "md5": "56b82f5898a485d037f2ccf0b45c493e",
                "sha256": "0c3890fbf7dbe3e9d880f9478569a0daecc921e3415c8a0e767322bf0a862313"
            },
            "downloads": -1,
            "filename": "wings_easy-0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "56b82f5898a485d037f2ccf0b45c493e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 19130,
            "upload_time": "2025-07-09T13:56:01",
            "upload_time_iso_8601": "2025-07-09T13:56:01.134026Z",
            "url": "https://files.pythonhosted.org/packages/4a/ec/fef6356eaacc96472a770ff3084e5fb42960940f59f19031108d1bcbaa07/wings_easy-0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "28238cf1dd7a783f9b538c34c4033e7c27bb3fba5ce2de09bf4c8188340f330f",
                "md5": "11d379c63c91611958480c0ef39ac16c",
                "sha256": "e8bbb9184cc25ffc7b13c11516f326dbf44690d4681a10397ec9445760eddcc0"
            },
            "downloads": -1,
            "filename": "wings_easy-0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "11d379c63c91611958480c0ef39ac16c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 18100,
            "upload_time": "2025-07-09T13:56:01",
            "upload_time_iso_8601": "2025-07-09T13:56:01.925393Z",
            "url": "https://files.pythonhosted.org/packages/28/23/8cf1dd7a783f9b538c34c4033e7c27bb3fba5ce2de09bf4c8188340f330f/wings_easy-0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-09 13:56:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "5hmlA",
    "github_project": "PyTools",
    "github_not_found": true,
    "lcname": "wings-easy"
}
        
Elapsed time: 0.41300s