Failed to execute script fbs_pyinstaller_hook

别来无恙 提交于 2020-08-10 13:11:56

问题


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

~/MyProject/target/AppName

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!

  • The most common mistake
  • Failed to execute script fbs_pyinstaller_hook for pyqt5 gui application

Any ideas of what to do?


回答1:


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



来源:https://stackoverflow.com/questions/63244980/failed-to-execute-script-fbs-pyinstaller-hook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!