使用pyinstaller打包you-get

打包you-get:Python脚本转可执行文件的实战教程
本文详细讲述了如何在Python 3.7-3.9环境中,使用PyInstaller处理you-get项目依赖,解决模块导入问题,以创建可执行文件的过程,包括隐藏导入和特定网站支持的注意事项。
该文章已生成可运行项目,

转:https://blog.lussac.net/archives/315/
依次安装以下依赖或运行相应命令。

Python 3.7-3.9
根据 PyInstaller 的 说明文档 ,其目前(2020-11-18) 支持的 Python 版本为 3.5-3.9。若需创建 32 位的可执行文件,请在 32 位 Python 环境下运行 PyInstaller。
PyInstaller

可以加上使用镜像源的参数: --index-url=https://pypi.tuna.tsinghua.edu.cn/simple

$ pip install pyinstaller
Git clone
$ git clone https://github.com/soimort/you-get.git
此外,下文在测试时 (2020-02-18),使用的各程序版本为:

Python: 3.7.6
you-get: 0.4.1403
PyInstaller: 3.6
Options
根据 Using PyInstaller — PyInstaller 3.6 documentation 所述,打包一个简单 Python 程序的命令为:

pyinstaller myscript.py
添加 -F 参数即可打包为单个可执行文件:

pyinstaller -F myscript.py
PyInstaller 会自动在当前目录下生成 build/ , dist/ , myscript.spec ,并且打包好的 myscript.exe 文件就在 dist/ 目录下。

但要打包 you-get 这样的项目,需要处理其中一些模块依赖的问题。虽然 PyInstaller 能够自行分析项目的模块依赖,但对于一些特殊情况,需要提供额外参数来解决模块依赖的问题。

Attempt
你可以 跳过 这一节,直接查看最终的命令。本节将叙述最终命令中各参数的意义。

首先进入 git clone 下来的 you-get 项目目录

$ cd you-get
$ ls
CHANGELOG.rst LICENSE.txt README.md setup.py* you-get*
contrib/ Makefile README.rst src/ you-get.json
CONTRIBUTING.md MANIFEST.in setup.cfg tests/ you-get.plugin.zsh*
尝试使用 PyInstaller 直接打包:

pyinstaller -F you-get
打包成功后,尝试运行则报错 No module named ‘you_get’ :

cd dist
you-get.exe -V

Traceback (most recent call last):
File “you-get”, line 9, in
ModuleNotFoundError: No module named ‘you_get’
[13528] Failed to execute script you-get
查阅 Helping PyInstaller Find Modules 后得知,由于 ./you-get 中使用了 sys.path ,需要通过 --path 参数为 PyInstaller 指明 you_get 这个模块在哪(即 ./src 目录下)。

cd …
pyinstaller -F --path=src you-get
cd dist
you-get.exe -V

you-get: version 0.4.1403, a tiny downloader that scrapes the web.
可以看到已经能正确输出版本号了,接下来试试获取视频信息:

you-get.exe -i https://www.bilibili.com/video/av59988590/

you-get: [error] oops, something went wrong.
# Omit for Brevity…
you-get: (4) Run the command with ‘–debug’ option,
you-get: and report this issue with the full output.
直接报错了,试试加上 --debug 参数:

you-get.exe -i https://www.bilibili.com/video/av59988590/ --debug

you-get: version 0.4.1403, a tiny downloader that scrapes the web.
# Omit for Brevity…
ModuleNotFoundError: No module named ‘you_get.extractors’
[1536] Failed to execute script you-get
那就尝试导入 you_get.extractors

cd …
pyinstaller -F --path=src you-get --hidden-import=you_get.extractors

cd dist

直接下载 (正常)

you-get.exe -i https://www.bilibili.com/video/av59988590/
you-get.exe -o D:/test https://www.bilibili.com/video/av59988590/

下载长一点的视频试试 (调用 FFmpeg 合并也没有问题)

you-get.exe --format=dash-flv360 https://www.bilibili.com/bangumi/play/ep285906

试试别的视频网站 (正常下载)

you-get.exe https://v.qq.com/x/cover/rjae621myqca41h.html

试试使用代理 (正常下载)

you-get.exe -x 127.0.0.1:10809 https://www.youtube.com/watch?v=Ie5qE1EHm_w

调用播放器 (能够唤起 PotPlayer 播放视频)

you-get.exe -p D:/MyProgram/PotPlayer/PotPlayerMini64.exe https://v.qq.com/x/cover/rjae621myqca41h.html

下载播放列表 (正常下载)

you-get.exe -l --format=dash-flv360 https://www.bilibili.com/bangumi/play/ep285906
似乎一切正常,但为了避免潜在问题,不妨将 src/you_get/cli_wrapper/ , src/you_get/processor/ , src/you_get/util/ 也都导入并打包:

pyinstaller -F --path=src you-get --hidden-import=you_get.extractors --hidden-import=you_get.cli_wrapper --hidden-import=you_get.processor --hidden-import=you_get.util

70 INFO: PyInstaller: 3.6
71 INFO: Python: 3.7.6
# Omit for Brevity…
4255 INFO: Analyzing hidden import ‘you_get.extractors’
4979 INFO: Analyzing hidden import ‘you_get.cli_wrapper’
4979 INFO: Processing module hooks…
# Omit for Brevity…
8347 INFO: Building EXE from EXE-00.toc completed successfully.
可以看到即使提供了四个 --hidden-import 参数,其导入时只用到了 you_get.extractors 和 you_get.cli_wrapper ,即便更换顺序也同样如此:

pyinstaller -F --path=src you-get --hidden-import=you_get.processor --hidden-import=you_get.cli_wrapper --hidden-import=you_get.util --hidden-import=you_get.extractors
暂不清楚其与下面的打包命令的结果有何不同,可能需要深入了解 PyInstaller 的工作原理和 You-Get 内部模块间的调用关系才能知晓。

pyinstaller -F --path=src you-get --hidden-import=you_get.extractors --hidden-import=you_get.cli_wrapper
Issues
网站支持
目前即使是 “通过 pip 安装的 you-get” 也似乎无法下载爱奇艺;解析腾讯视频只有单一清晰度。对此请通过 annie 下载。

$ you-get --format=LD https://www.iqiyi.com/v_19ruzj8gv0.html
特殊情况
对于某些视频网站(如西瓜视频),使用 “通过 pip 安装的 you-get” 能正常下载,而使用 “以上文方法打包的 you-get.exe” 则无法下载,例如:

正常下载

$ you-get https://www.ixigua.com/i6701579536644964872

无法下载

you-get.exe https://www.ixigua.com/i6701579536644964872 --debug

you-get: version 0.4.1403, a tiny downloader that scrapes the web.
# Omit for Brevity…
ModuleNotFoundError: No module named ‘you_get.extractors.ixigua’
[12120] Failed to execute script you-get
根据提示导入 you_get.extractors.ixigua 重新打包后,能够正常下载。

pyinstaller -F --path=src you-get --hidden-import=you_get.extractors --hidden-import=you_get.cli_wrapper --hidden-import=you_get.processor --hidden-import=you_get.util --hidden-import=you_get.extractors.ixigua

正常下载

you-get.exe https://www.ixigua.com/i6701579536644964872
导致需要额外导入单个站点模块的原因可能是 src/you_get/extractors/init.py 中没有以下语句:

from .ixigua import *
若加上这一句后再执行打包,则无需 --hidden-import=you_get.extractors.ixigua 也能正常下载。

pyinstaller -F --path=src you-get --hidden-import=you_get.extractors --hidden-import=you_get.cli_wrapper --hidden-import=you_get.processor --hidden-import=you_get.util

正常下载

you-get.exe https://www.ixigua.com/i6701579536644964872
与之相同的,在 src/you_get/extractors/ 目录下有对应 extractor (100) 却未在 src/you_get/extractors/init.py (88) 中 import 的站点有:

baomihua.py
giphy.py
huomaotv.py
iwara.py
ixigua.py
missevan.py
qie_video.py
qq_egame.py
toutiao.py
vidto.py
ximalaya.py
yizhibo.py
此外还有一些出现在 Release 的 you-get-0.4.1403.tar.gz 中,却不在 GitHub 源码中的 extractors (10),包含:

_blip.py
_catfun.py
_coursera.py
_dongting.py
_jpopsuki.py
_qianmo.py
_songtaste.py
_thvideo.py
_vid48.py
_videobam.py
这些 extractors 均以 _ 开头,而(参照 Makefile)直接运行 python setup.py sdist生成的 dist/you-get-0.4.1403.tar.gz 则不包含这些 extractors 。 暂不知其原因。

根据上文分析,可以想到解决办法为:将 “you-get-0.4.1403.tar.gz” you-get-0.4.1403/src/you_get/extractors/ 中以 _ 开头的 py 文件复制到 clone 目录对应位置,并编辑 src/you_get/extractors/init.py ,在其中逐一导入这些模块,最后再重新打包。

为 src/you_get/extractors/init.py 文件追加以下语句

from .baomihua import *
from .giphy import *
from .huomaotv import *
from .iwara import *
from .ixigua import *
from .missevan import *
from .qie_video import *
from .qq_egame import *
from .toutiao import *
from .vidto import *
from .ximalaya import *
from .yizhibo import *

from ._blip import *
from ._catfun import *
from ._coursera import *
from ._dongting import *
from ._jpopsuki import *
from ._qianmo import *
from ._songtaste import *
from ._thvideo import *
from ._vid48 import *
from ._videobam import *
Final command
综上所述, 最后打包的命令为 :

pyinstaller -F --path=src you-get --hidden-import=you_get.extractors --hidden-import=you_get.cli_wrapper --hidden

本文章已经生成可运行项目
Windows PowerShell 版权所有(C) Microsoft Corporation。保留所有权利。 安装最新的 PowerShell,了解新功能和改进!https://aka.ms/PSWindows (.venv) PS E:\PyCharmObject\emailSingUp\SignUp> python -m venv packaging_env (.venv) PS E:\PyCharmObject\emailSingUp\SignUp> packaging_env\Scripts\activate (packaging_env) PS E:\PyCharmObject\emailSingUp\SignUp> pyinstaller -F -w -i outlook.ico AccountRegisterApp.py 116 INFO: PyInstaller: 6.15.0, contrib hooks: 2025.8 116 INFO: Python: 3.9.13 131 INFO: Platform: Windows-10-10.0.26100-SP0 131 INFO: Python environment: E:\DEMO\python-demo\.venv 131 INFO: wrote E:\PyCharmObject\emailSingUp\SignUp\AccountRegisterApp.spec 131 INFO: Module search paths (PYTHONPATH): ['E:\\DEMO\\python-demo\\.venv\\Scripts\\pyinstaller.exe', 'E:\\Program Files\\Python3.9\\python39.zip', 'E:\\Program Files\\Python3.9\\DLLs', 'E:\\Program Files\\Python3.9\\lib', 'E:\\Program Files\\Python3.9', 'E:\\DEMO\\python-demo\\.venv', 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages', 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\setuptools\\_vendor', 'E:\\PyCharmObject\\emailSingUp\\SignUp'] 380 INFO: checking Analysis 401 INFO: Building because inputs changed 401 INFO: Running Analysis Analysis-00.toc 401 INFO: Target bytecode optimization level: 0 401 INFO: Initializing module dependency graph... 401 INFO: Initializing module graph hook caches... 413 INFO: Analyzing modules for base_library.zip ... 885 INFO: Processing standard module hook 'hook-heapq.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 981 INFO: Processing standard module hook 'hook-encodings.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 1572 INFO: Processing standard module hook 'hook-pickle.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 2079 INFO: Caching module dependency graph... 2098 INFO: Looking for Python shared library... 2106 INFO: Using Python shared library: E:\Program Files\Python3.9\python39.dll 2106 INFO: Analyzing E:\PyCharmObject\emailSingUp\SignUp\AccountRegisterApp.py 2106 INFO: Processing pre-find-module-path hook 'hook-tkinter.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path' 2106 INFO: TclTkInfo: initializing cached Tcl/Tk info... 2248 INFO: Processing standard module hook 'hook-_tkinter.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 2280 INFO: Processing standard module hook 'hook-pandas.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 3137 INFO: Processing standard module hook 'hook-_ctypes.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 3147 INFO: Processing standard module hook 'hook-platform.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 3162 INFO: Processing standard module hook 'hook-sysconfig.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 3172 INFO: Processing standard module hook 'hook-numpy.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 3984 INFO: Processing standard module hook 'hook-difflib.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 4064 INFO: Processing standard module hook 'hook-multiprocessing.util.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 4103 INFO: Processing standard module hook 'hook-xml.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 4731 INFO: Processing standard module hook 'hook-charset_normalizer.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\_pyinstaller_hooks_contrib\\stdhooks' 4775 INFO: Processing pre-safe-import-module hook 'hook-typing_extensions.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module' 4775 INFO: SetuptoolsInfo: initializing cached setuptools info... 7047 INFO: Processing standard module hook 'hook-pytz.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 8229 INFO: Processing standard module hook 'hook-pandas.io.formats.style.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 9298 INFO: Processing standard module hook 'hook-pandas.plotting.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 9580 INFO: Processing standard module hook 'hook-openpyxl.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\_pyinstaller_hooks_contrib\\stdhooks' 9713 INFO: Processing standard module hook 'hook-xml.etree.cElementTree.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 9948 INFO: Processing standard module hook 'hook-PIL.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 9998 INFO: Processing standard module hook 'hook-PIL.Image.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 10309 INFO: Processing standard module hook 'hook-PIL.ImageFilter.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 11031 INFO: Processing standard module hook 'hook-sqlite3.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 11265 INFO: Processing standard module hook 'hook-pandas.io.clipboard.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 11265 INFO: Processing standard module hook 'hook-qtpy.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 11334 WARNING: QtLibraryInfo(PyQt5): failed to obtain Qt library info: Child process call to _read_qt_library_info() failed with: File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 63, in run_next_command output = function(*args, **kwargs) File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\utils\hooks\qt\__init__.py", line 198, in _read_qt_library_info QtCore = importlib.import_module('.QtCore', package) File "E:\Program Files\Python3.9\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1030, in _gcd_import File "<frozen importlib._bootstrap>", line 1007, in _find_and_load File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 666, in _load_unlocked File "<frozen importlib._bootstrap>", line 565, in module_from_spec File "<frozen importlib._bootstrap_external>", line 1173, in create_module File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed ImportError: DLL load failed while importing QtCore: 找不到指定的程序。 A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.2 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'. If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. We expect that some modules will need time to support NumPy 2. Traceback (most recent call last): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 100, in <module> while run_next_command(read_fh, write_fh): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 63, in run_next_command output = function(*args, **kwargs) File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\utils\hooks\qt\__init__.py", line 198, in _read_qt_library_info QtCore = importlib.import_module('.QtCore', package) File "E:\Program Files\Python3.9\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 107, in <module> _setupQtDirectories() File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 58, in _setupQtDirectories import shiboken2 File "E:\DEMO\python-demo\.venv\lib\site-packages\shiboken2\__init__.py", line 27, in <module> from .shiboken2 import * 11562 INFO: hook-qtpy: selected 'PySide2' as the only available Qt bindings. 11563 INFO: Processing pre-safe-import-module hook 'hook-packaging.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module' 11571 INFO: Processing standard module hook 'hook-PySide2.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 11614 INFO: Processing standard module hook 'hook-PySide2.QtNetwork.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.2 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'. If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. We expect that some modules will need time to support NumPy 2. Traceback (most recent call last): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 100, in <module> while run_next_command(read_fh, write_fh): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 63, in run_next_command output = function(*args, **kwargs) File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 337, in _get_module_file_attribute loader = importlib.util.find_spec(package).loader File "E:\Program Files\Python3.9\lib\importlib\util.py", line 94, in find_spec parent = __import__(parent_name, fromlist=['__path__']) File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 107, in <module> _setupQtDirectories() File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 58, in _setupQtDirectories import shiboken2 File "E:\DEMO\python-demo\.venv\lib\site-packages\shiboken2\__init__.py", line 27, in <module> from .shiboken2 import * A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.2 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'. If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. We expect that some modules will need time to support NumPy 2. Traceback (most recent call last): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 100, in <module> while run_next_command(read_fh, write_fh): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 63, in run_next_command output = function(*args, **kwargs) File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\utils\hooks\qt\__init__.py", line 670, in _check_if_openssl_enabled QtCore = importlib.import_module('.QtCore', package) File "E:\Program Files\Python3.9\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 107, in <module> _setupQtDirectories() File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 58, in _setupQtDirectories import shiboken2 File "E:\DEMO\python-demo\.venv\lib\site-packages\shiboken2\__init__.py", line 27, in <module> from .shiboken2 import * 12364 INFO: Processing standard module hook 'hook-PySide2.QtCore.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.2 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'. If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. We expect that some modules will need time to support NumPy 2. Traceback (most recent call last): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 100, in <module> while run_next_command(read_fh, write_fh): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 63, in run_next_command output = function(*args, **kwargs) File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 337, in _get_module_file_attribute loader = importlib.util.find_spec(package).loader File "E:\Program Files\Python3.9\lib\importlib\util.py", line 94, in find_spec parent = __import__(parent_name, fromlist=['__path__']) File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 107, in <module> _setupQtDirectories() File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 58, in _setupQtDirectories import shiboken2 File "E:\DEMO\python-demo\.venv\lib\site-packages\shiboken2\__init__.py", line 27, in <module> from .shiboken2 import * 12580 INFO: Processing standard module hook 'hook-PySide2.QtDataVisualization.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.2 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'. If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. We expect that some modules will need time to support NumPy 2. Traceback (most recent call last): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 100, in <module> while run_next_command(read_fh, write_fh): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 63, in run_next_command output = function(*args, **kwargs) File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 337, in _get_module_file_attribute loader = importlib.util.find_spec(package).loader File "E:\Program Files\Python3.9\lib\importlib\util.py", line 94, in find_spec parent = __import__(parent_name, fromlist=['__path__']) File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 107, in <module> _setupQtDirectories() File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 58, in _setupQtDirectories import shiboken2 File "E:\DEMO\python-demo\.venv\lib\site-packages\shiboken2\__init__.py", line 27, in <module> from .shiboken2 import * 13096 INFO: Processing standard module hook 'hook-PySide2.QtGui.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.2 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'. If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. We expect that some modules will need time to support NumPy 2. Traceback (most recent call last): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 100, in <module> while run_next_command(read_fh, write_fh): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 63, in run_next_command output = function(*args, **kwargs) File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 337, in _get_module_file_attribute loader = importlib.util.find_spec(package).loader File "E:\Program Files\Python3.9\lib\importlib\util.py", line 94, in find_spec parent = __import__(parent_name, fromlist=['__path__']) File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 107, in <module> _setupQtDirectories() File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 58, in _setupQtDirectories import shiboken2 File "E:\DEMO\python-demo\.venv\lib\site-packages\shiboken2\__init__.py", line 27, in <module> from .shiboken2 import * 13798 INFO: Processing standard module hook 'hook-PySide2.QtWidgets.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.2 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'. If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. We expect that some modules will need time to support NumPy 2. Traceback (most recent call last): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 100, in <module> while run_next_command(read_fh, write_fh): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 63, in run_next_command output = function(*args, **kwargs) File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 337, in _get_module_file_attribute loader = importlib.util.find_spec(package).loader File "E:\Program Files\Python3.9\lib\importlib\util.py", line 94, in find_spec parent = __import__(parent_name, fromlist=['__path__']) File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 107, in <module> _setupQtDirectories() File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 58, in _setupQtDirectories import shiboken2 File "E:\DEMO\python-demo\.venv\lib\site-packages\shiboken2\__init__.py", line 27, in <module> from .shiboken2 import * 14131 INFO: Processing standard module hook 'hook-dateutil.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\_pyinstaller_hooks_contrib\\stdhooks' 14198 INFO: Processing pre-safe-import-module hook 'hook-six.moves.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module' 14331 INFO: Processing standard module hook 'hook-xml.dom.domreg.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 14713 INFO: Processing standard module hook 'hook-PyQt5.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' ERROR: Aborting build process due to attempt to collect multiple Qt bindings packages: attempting to run hook for 'PyQt5', while hook for 'PySide2' has already been run! PyInstaller does not support multiple Qt bindings packages in a frozen application - either ensure that the build environment has only one Qt bindings package installed, or exclude the extraneous bindings packages via the module exclusion mechanism (--exclude command-line option, or excludes list in the spec file). (packaging_env) PS E:\PyCharmObject\emailSingUp\SignUp> 打包后没有生成exe程序
最新发布
09-06
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值