我正在尝试制作一个独立的 pyside6 应用程序,其中包含一些机器学习功能,例如 Yolo。 一切都在虚拟环境中运行。 Ubuntu 20.04.6 LTS Python 3.8.10
我仅为 Ubuntu 构建应用程序,但我也计划将其部署到 Windows。
请查看命令行输出。 另外,该命令花了很长时间才能完成(~3 小时)
命令:
(tensorflow_env) navaneeth@ramakrishnann-u-det:~/workspace/OMS/action_detection/standalone_app/Qt-App-4-deploy$ pyside6-deploy mainwindow.py
Collecting nuitka==1.8.0
Using cached Nuitka-1.8-cp38-cp38-linux_x86_64.whl
Collecting ordered-set>=4.1.0 (from nuitka==1.8.0)
Using cached ordered_set-4.1.0-py3-none-any.whl.metadata (5.3 kB)
Collecting zstandard>=0.15 (from nuitka==1.8.0)
Using cached zstandard-0.23.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.0 kB)
Using cached ordered_set-4.1.0-py3-none-any.whl (7.6 kB)
Using cached zstandard-0.23.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.4 MB)
Installing collected packages: zstandard, ordered-set, nuitka
Attempting uninstall: zstandard
Found existing installation: zstandard 0.23.0
Uninstalling zstandard-0.23.0:
Successfully uninstalled zstandard-0.23.0
Attempting uninstall: ordered-set
Found existing installation: ordered-set 4.1.0
Uninstalling ordered-set-4.1.0:
Successfully uninstalled ordered-set-4.1.0
Attempting uninstall: nuitka
Found existing installation: Nuitka 1.8
Uninstalling Nuitka-1.8:
Successfully uninstalled Nuitka-1.8
Successfully installed nuitka-1.8 ordered-set-4.1.0 zstandard-0.23.0
[notice] A new release of pip is available: 24.0 -> 24.2
[notice] To update, run: pip install --upgrade pip
Nuitka-Plugins:WARNING: anti-bloat: Undesirable import of 'setuptools' (intending to avoid 'setuptools') in 'triton.common.build' (at
Nuitka-Plugins:WARNING: '/home/navaneeth/workspace/OMS/tensorflow_env/lib/python3.8/site-packages/triton/common/build.py:10') encountered. It may slow down compilation.
Nuitka-Plugins:WARNING: Complex topic! More information can be found at https://nuitka.net/info/unwanted-module.html
Nuitka-Plugins:WARNING: anti-bloat: Undesirable import of 'unittest' (intending to avoid 'unittest') in 'torch._dynamo.testing' (at
Nuitka-Plugins:WARNING: '/home/navaneeth/workspace/OMS/tensorflow_env/lib/python3.8/site-packages/torch/_dynamo/testing.py:10') encountered. It may slow down compilation.
Nuitka-Plugins:WARNING: Complex topic! More information can be found at https://nuitka.net/info/unwanted-module.html
Nuitka-Plugins:WARNING: anti-bloat: Undesirable import of 'IPython' (intending to avoid 'IPython') in 'ultralytics.utils.checks' (at
Nuitka-Plugins:WARNING: '/home/navaneeth/workspace/OMS/tensorflow_env/lib/python3.8/site-packages/ultralytics/utils/checks.py:574') encountered. It may slow down compilation.
Nuitka-Plugins:WARNING: Complex topic! More information can be found at https://nuitka.net/info/unwanted-module.html
Nuitka-Plugins:WARNING: anti-bloat: Undesirable import of 'IPython' (intending to avoid 'IPython') in 'ultralytics.utils.checks' (at
Nuitka-Plugins:WARNING: '/home/navaneeth/workspace/OMS/tensorflow_env/lib/python3.8/site-packages/ultralytics/utils/checks.py:574') encountered. It may slow down compilation.
Nuitka-Plugins:WARNING: Complex topic! More information can be found at https://nuitka.net/info/unwanted-module.html
{standard input}: Assembler messages:
{standard input}:48541: Warning: end of file not at end of a line; newline inserted
{standard input}:49639: Error: number of operands mismatch for `jmp'
{standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive
gcc: fatal error: Killed signal terminated program cc1
compilation terminated.
scons: *** [module.yt_dlp.extractor.lazy_extractors.o] Error 1
[DEPLOY] Exception occurred: Traceback (most recent call last):
File "/home/navaneeth/workspace/OMS/tensorflow_env/lib/python3.8/site-packages/PySide6/scripts/deploy_lib/commands.py", line 24, in run_command
subprocess.check_call(command, shell=is_windows)
File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/navaneeth/workspace/OMS/tensorflow_env/bin/python', '-m', 'nuitka', '/home/navaneeth/workspace/OMS/action_detection/standalone_app/Qt-App-4-deploy/mainwindow.py', '--follow-imports', '--onefile', '--enable-plugin=pyside6', '--output-dir=/home/navaneeth/workspace/OMS/action_detection/standalone_app/Qt-App-4-deploy/deployment', '--quiet', '--noinclude-qt-translations', '--linux-icon=/home/navaneeth/workspace/OMS/tensorflow_env/lib/python3.8/site-packages/PySide6/scripts/deploy_lib/pyside_icon.jpg']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/navaneeth/workspace/OMS/tensorflow_env/lib/python3.8/site-packages/PySide6/scripts/deploy.py", line 102, in main
command_str = python.create_executable(source_file=config.source_file,
File "/home/navaneeth/workspace/OMS/tensorflow_env/lib/python3.8/site-packages/PySide6/scripts/deploy_lib/python_helper.py", line 200, in create_executable
command_str = self.nuitka.create_executable(source_file=source_file,
File "/home/navaneeth/workspace/OMS/tensorflow_env/lib/python3.8/site-packages/PySide6/scripts/deploy_lib/nuitka_helper.py", line 65, in create_executable
command_str, _ = run_command(command=command, dry_run=dry_run)
File "/home/navaneeth/workspace/OMS/tensorflow_env/lib/python3.8/site-packages/PySide6/scripts/deploy_lib/commands.py", line 30, in run_command
raise RuntimeError(
RuntimeError: [DEPLOY] Command /home/navaneeth/workspace/OMS/tensorflow_env/bin/python -m nuitka /home/navaneeth/workspace/OMS/action_detection/standalone_app/Qt-App-4-deploy/mainwindow.py --follow-imports --onefile --enable-plugin=pyside6 --output-dir=/home/navaneeth/workspace/OMS/action_detection/standalone_app/Qt-App-4-deploy/deployment --quiet --noinclude-qt-translations --linux-icon=/home/navaneeth/workspace/OMS/tensorflow_env/lib/python3.8/site-packages/PySide6/scripts/deploy_lib/pyside_icon.jpg failed with error Command '['/home/navaneeth/workspace/OMS/tensorflow_env/bin/python', '-m', 'nuitka', '/home/navaneeth/workspace/OMS/action_detection/standalone_app/Qt-App-4-deploy/mainwindow.py', '--follow-imports', '--onefile', '--enable-plugin=pyside6', '--output-dir=/home/navaneeth/workspace/OMS/action_detection/standalone_app/Qt-App-4-deploy/deployment', '--quiet', '--noinclude-qt-translations', '--linux-icon=/home/navaneeth/workspace/OMS/tensorflow_env/lib/python3.8/site-packages/PySide6/scripts/deploy_lib/pyside_icon.jpg']' returned non-zero exit status 1. and return_code1
这可能是由于 gcc 被终止后系统资源不足,请使用“free -h”检查可用内存并尝试,
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
这将创建一个 4GB 的交换文件。
还要确保正确的 gcc 工具链,
sudo apt update
sudo apt install build-essential gcc g++ libstdc++6
也尝试更新 nuitka,
pip install --upgrade nuitka