我正在尝试从我的 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.
但我在我的代码中导入版本为5
: matplotlib.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
我已经检查了这些链接中给出的解决方案,但没有一个派上用场!
有什么想法吗?