1

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!

Any ideas of what to do?

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Shahriar.M
  • 818
  • 1
  • 11
  • 24

1 Answers1

1

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

JareBear
  • 467
  • 9
  • 27
  • now I get another error: `NameError: name 'defaultParams' is not defined` `Failed to execute script main` is it my code which has error or something else is the problem? – Shahriar.M Aug 04 '20 at 15:21
  • when compiling to pyinstaller just do `pyinstaller -F main.py` Then open up the command prompt or terminal and run the file there so you read the error with more information. – JareBear Aug 05 '20 at 03:09
  • it is the error now: `NameError: name 'defaultParams' is not defined`. should I update question? – Shahriar.M Aug 05 '20 at 05:42
  • somewhere you didn't define that in your code.. Is that a library? or a variable? – JareBear Aug 05 '20 at 20:31
  • no one, its a `pyinstaller` issue. I found my answer [here](https://github.com/matplotlib/matplotlib/issues/18180) – Shahriar.M Aug 06 '20 at 04:53
  • 1
    Great! Awesome! Maybe write a new a answer and explain your solution. – JareBear Aug 06 '20 at 17:54