本文介绍了无法执行脚本fbs_pyinstaller_hook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

  • Ubuntu 18.04
  • 蟒蛇 (3.6.9)
  • fbs(0.8.9)
  • matplotlib (3.3.0)
  • numpy(1.19.1)
  • 熊猫 (1.1.0)

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

fbs freeze 命令产生这个输出:

  -c:12:MatplotlibDeprecation警告:matplotlib.backends.backend_qt4agg 后端在 Matplotlib 3.3 中已弃用,并将在两个次要版本后删除.完毕.您现在可以运行`target/DataVisualization/DataVisualization`.如果那行不通,请参阅https://build-system.fman.io/troubleshooting.

但是我在我的代码中导入了 matplotlib.backends.backend_qt4agg5 版本:

从matplotlib.backends.backend_qt5agg中的

 导入FigureCanvasQTAgg,NavigationToolbar2QT作为NavigationToolbar

当我从

运行可执行文件时

~/MyProject/target/AppName

我收到此错误:

  ./AppName回溯(最近一次调用最后一次):< module>中的文件"fbs_pyinstaller_hook.py",第2行.文件importlib/__init__.py",第 126 行,在 import_module 中_gcd_import中的文件< frozen importlib._bootstrap>"行994_find_and_load中的文件< frozen importlib._bootstrap>",第971行_find_and_load_unlocked中的文件< frozen importlib._bootstrap>"行941_call_with_frames_removed中的文件< frozen importlib._bootstrap>",第219行文件",第 994 行,在 _gcd_import 中文件",第 971 行,在 _find_and_load 中文件",第 953 行,在 _find_and_load_unlockedModuleNotFoundError: 没有名为fbs_runtime"的模块[1331] 无法执行脚本 fbs_pyinstaller_hook

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

关于做什么的任何想法?

解决方案

我完全放弃了使用FBS的方法.pyinstaller对于编译PyQt5代码非常有效.

I'm trying to create an executable file from the my PyQt5 application. my system specs:

  • ubuntu 18.04
  • python (3.6.9)
  • fbs (0.8.9)
  • matplotlib (3.3.0)
  • numpy (1.19.1)
  • pandas (1.1.0)

I'm following fbs tutorial to build a executable file from my application. I run the application without error with fbs run command.

The fbs freeze command produce this output:

-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.

But I'm importing version 5 of matplotlib.backends.backend_qt4agg in my code as:

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

when I run the executable file from

I get this error:

./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

I have checked the solutions given in these links, but none of them came handy!

Any ideas of what to do?

解决方案

I entirely gave up using FBS.. pyinstaller works very well for compiling PyQt5 code.. try using just pyinstaller and see if that works.

这篇关于无法执行脚本fbs_pyinstaller_hook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 16:46