使用 pyside6-deploy 为 Windows 11 打包的 Python 应用程序抱怨 numpy 安装

问题描述 投票:0回答:1

我花了一天时间开发基于 Pandas 简单示例的 Qt POC 应用程序,并尝试使用 pyside6-deploy 对其进行打包。 Linux 部分在 WSL 上运行良好,一旦我安装了 gcc.exe 和其余部分,在 Windows 11 上运行和打包所有内容似乎也运行良好。

但是,当我尝试在 Windows 上运行 .exe 文件时,出现以下错误:

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.

我已经做了一些搜索,但到目前为止我发现的建议希望我从源代码构建 numpy。这感觉有点倒退。

我没有使用任何requirements.txt或pyproject.toml文件,因为唯一的依赖项是Pandas

Windows 上的 Python 版本是 3.10,因为后来的版本与 Nuitka 不能很好地配合

我做错了什么?

编辑:运行其他更简单的示例,无需任何非 PyQT 包依赖项即可正常工作。

python pyqt pyside6 python-3.10 nuitka
1个回答
0
投票

您可以使用 Auto_py_to_exe 将其打包为 Windows 11。

Working Gif

pip install auto-py-to-exe
auto-py-to-exe [-nc] [-c [CONFIG]] [-o [PATH]] [filename]

欲了解更多信息,您可以访问其文档: 文档

© www.soinside.com 2019 - 2024. All rights reserved.