1

我正在尝试从我的 PyQt5 应用程序创建一个可执行文件。我的系统规格:

  • Ubuntu 18.04
  • 蟒蛇(3.6.9)
  • 脸书 (0.8.9)
  • matplotlib (3.3.0)
  • 麻木(1.19.1)
  • 熊猫 (1.1.0)

我正在按照fbs 教程从我的应用程序构建一个可执行文件。我使用命令运行应用程序而没有错误fbs run

fbs freeze命令产生以下输出:

-c:12: MatplotlibDeprecationWarning: 
The matplotlib.backends.backend_qt4agg backend was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
Done. You can now run `target/DataVisualization/DataVisualization`. If
that doesn't work, see https://build-system.fman.io/troubleshooting.

但我在我的代码中导入版本为5matplotlib.backends.backend_qt4agg

from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg, NavigationToolbar2QT as NavigationToolbar

当我从

~/MyProject/target/AppName

我收到此错误:

./AppName 
Traceback (most recent call last):
  File "fbs_pyinstaller_hook.py", line 2, in <module>
  File "importlib/__init__.py", line 126, in import_module
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'fbs_runtime'
[1331] Failed to execute script fbs_pyinstaller_hook

我已经检查了这些链接中给出的解决方案,但没有一个派上用场!

有什么想法吗?

4

1 回答 1

1

我完全放弃了使用 FBS .. pyinstaller 非常适合编译 PyQt5 代码.. 尝试只使用 pyinstaller 看看是否有效。

于 2020-08-04T12:47:07.090 回答