环境如下
python 版本:3.7.6
tensorflow 版本:2.1.0
pyinstaller 版本:4.0
出现错误如下,自己检索了网友们的解决方案,看不懂,来求助一下大家
打包时输出部分错误如下:
92309 WARNING: Hidden import "tensorflow_core._api.v2.compat.v2.compat.v2.keras.preprocessing.sequence" not found!
92309 WARNING: Hidden import "tensorflow_core._api.v2.compat.v2.estimator.export" not found!
92966 WARNING: Hidden import "tensorflow_core._api.v2.compat.v2.compat.v1.keras.datasets.mnist" not found!
93060 WARNING: Hidden import "tensorflow_core._api.v2.compat.v1.keras.initializers" not found!
93388 WARNING: Hidden import "tensorflow_core._api.v2.compat.v1.keras.experimental" not found!
93544 WARNING: Hidden import "tensorflow_core._api.v2.compat.v2.compat.v2.keras.wrappers.scikit_learn" not found!
93544 WARNING: Hidden import "tensorflow_core._api.v2.compat.v2.compat.v2.keras.estimator" not found!
93653 WARNING: Hidden import "tensorflow_core._api.v2.compat.v2.keras.applications" not found!
93653 WARNING: Hidden import "tensorflow_core._api.v2.compat.v2.compat.v2.keras.layers.experimental" not found!
93888 WARNING: Hidden import "tensorflow_core._api.v2.compat.v2.keras.datasets.fashion_mnist" not found!
94091 WARNING: Hidden import "tensorflow_core._api.v2.compat.v1.keras.wrappers" not found!
94091 WARNING: Hidden import "tensorflow_core._api.v2.compat.v1.keras" not found!
130818 INFO: Import to be excluded not found: 'tensorflow.python._pywrap_tensorflow_internal'
130818 INFO: Loading module hook '
hook-win32com.py' from 'c:\\users\\chiyeungleung\\anaconda3\\envs\\mhpy\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
130943 INFO: Loading module hook '
hook-distutils.py' from 'c:\\users\\chiyeungleung\\anaconda3\\envs\\mhpy\\lib\\site-packages\\PyInstaller\\hooks'...
130943 INFO: Loading module hook '
hook-encodings.py' from 'c:\\users\\chiyeungleung\\anaconda3\\envs\\mhpy\\lib\\site-packages\\PyInstaller\\hooks'...
131115 INFO: Loading module hook '
hook-lib2to3.py' from 'c:\\users\\chiyeungleung\\anaconda3\\envs\\mhpy\\lib\\site-packages\\PyInstaller\\hooks'...
131194 INFO: Loading module hook '
hook-matplotlib.backends.py' from 'c:\\users\\chiyeungleung\\anaconda3\\envs\\mhpy\\lib\\site-packages\\PyInstaller\\hooks'...
132446 INFO: Matplotlib backend "GTK3Agg": ignored
backend Gtk3Agg requires cairo
133087 INFO: Matplotlib backend "GTK3Cairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffiis installed
133602 INFO: Matplotlib backend "MacOSX": ignored
cannot import name '_macosx' from 'matplotlib.backends' (c:\users\chiyeungleung\anaconda3\envs\mhpy\lib\site-packages\matplotlib\backends\
__init__.py)
134165 INFO: Matplotlib backend "nbAgg": ignored
No module named 'IPython'
-c:12: MatplotlibDeprecationWarning:
The matplotlib.backends.backend_qt4agg backend was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
134916 INFO: Matplotlib backend "Qt4Agg": added
135465 INFO: Matplotlib backend "Qt4Cairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffiis installed
136246 INFO: Matplotlib backend "Qt5Agg": added
136761 INFO: Matplotlib backend "Qt5Cairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffiis installed
138011 INFO: Matplotlib backend "TkAgg": added
139136 INFO: Matplotlib backend "TkCairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffiis installed
139745 INFO: Matplotlib backend "WebAgg": ignored
Traceback (most recent call last):
File "c:\users\chiyeungleung\anaconda3\envs\mhpy\lib\site-packages\matplotlib\backends\
backend_webagg.py", line 27, in <module>
import tornado
ModuleNotFoundError: No module named 'tornado'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<string>", line 12, in <module>
File "c:\users\chiyeungleung\anaconda3\envs\mhpy\lib\site-packages\matplotlib\backends\
backend_webagg.py", line 29, in <module>
raise RuntimeError("The WebAgg backend requires Tornado.") from err
RuntimeError: The WebAgg backend requires Tornado.
140562 INFO: Matplotlib backend "WX": ignored
No module named 'wx'
141168 INFO: Matplotlib backend "WXAgg": ignored
No module named 'wx'
141761 INFO: Matplotlib backend "WXCairo": ignored
No module named 'wx'
149983 INFO: Loading module hook '
hook-pkg_resources.py' from 'c:\\users\\chiyeungleung\\anaconda3\\envs\\mhpy\\lib\\site-packages\\PyInstaller\\hooks'...
150940 WARNING: Hidden import "pkg_resources.py2_warn" not found!
150940 WARNING: Hidden import "pkg_resources.markers" not found!