我正在尝试使用pyinstaller创建.exe文件。为此,我以前使用的是anaconda,这导致文件很大。因此,我将其卸载,然后创建了一个虚拟环境,并使用pip手动安装了所需的模块。
但是,在运行命令: pyinstaller -w -F -i“ iconaddress” filename.py 时,该过程开始,但在以下行停止: 46785信息:正在加载模块挂钩“ hook-PyQt5.py” ...
完整的命令提示符代码如下:
107 INFO: PyInstaller: 3.6
107 INFO: Python: 3.8.2
107 INFO: Platform: Windows-10-10.0.16299-SP0
107 INFO: wrote C:\Users\26039190\refcal\RefCal_v4.spec
123 INFO: UPX is not available.
123 INFO: Extending PYTHONPATH with paths
['C:\\Users\\26039190\\refcal', 'C:\\Users\\26039190\\refcal']
123 INFO: checking Analysis
123 INFO: Building Analysis because Analysis-00.toc is non existent
123 INFO: Initializing module dependency graph...
139 INFO: Caching module graph hooks...
154 INFO: Analyzing base_library.zip ...
3935 INFO: Processing pre-find module path hook distutils
3936 INFO: distutils: retargeting to non-venv dir 'C:\\Users\\26039190\\AppData\\Local\\Programs\\Python\\Python38-32\\lib'
9745 INFO: Caching module dependency graph...
10022 INFO: running Analysis Analysis-00.toc
10033 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\users\26039190\refcal\sal\scripts\python.exe
10103 INFO: Analyzing C:\Users\26039190\refcal\RefCal_v4.py
14456 INFO: Processing pre-find module path hook site
14456 INFO: site: retargeting to fake-dir 'c:\\users\\26039190\\refcal\\sal\\lib\\site-packages\\PyInstaller\\fake-modules'
16186 INFO: Processing pre-safe import module hook setuptools.extern.six.moves
27390 INFO: Processing pre-safe import module hook six.moves
30413 INFO: Processing module hooks...
30413 INFO: Loading module hook "hook-distutils.py"...
30413 INFO: Loading module hook "hook-encodings.py"...
30551 INFO: Loading module hook "hook-lib2to3.py"...
30551 INFO: Loading module hook "hook-matplotlib.backends.py"...
31668 INFO: Matplotlib backend "GTK3Agg": ignored
backend Gtk3Agg requires cairo
32215 INFO: Matplotlib backend "GTK3Cairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffiis installed
32753 INFO: Matplotlib backend "MacOSX": ignored
cannot import name '_macosx' from 'matplotlib.backends' (c:\users\26039190\refcal\sal\lib\site-packages\matplotlib\backends\__init__.py)
33286 INFO: Matplotlib backend "nbAgg": ignored
No module named 'IPython'
33988 INFO: Matplotlib backend "Qt4Agg": added
34457 INFO: Matplotlib backend "Qt4Cairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffiis installed
35085 INFO: Matplotlib backend "Qt5Agg": added
35602 INFO: Matplotlib backend "Qt5Cairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffiis installed
36443 INFO: Matplotlib backend "TkAgg": added
37160 INFO: Matplotlib backend "TkCairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffiis installed
37877 INFO: Matplotlib backend "WebAgg": added
38594 INFO: Matplotlib backend "WX": ignored
No module named 'wx'
39210 INFO: Matplotlib backend "WXAgg": ignored
No module named 'wx'
39823 INFO: Matplotlib backend "WXCairo": ignored
No module named 'wx'
40500 INFO: Matplotlib backend "agg": added
41018 INFO: Matplotlib backend "cairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffiis installed
41663 INFO: Matplotlib backend "pdf": added
42433 INFO: Matplotlib backend "pgf": added
43046 INFO: Matplotlib backend "ps": added
43561 INFO: Matplotlib backend "svg": added
44326 INFO: Matplotlib backend "template": added
44880 INFO: Loading module hook "hook-matplotlib.py"...
45742 INFO: Loading module hook "hook-numpy.core.py"...
45905 INFO: Loading module hook "hook-numpy.py"...
45905 INFO: Loading module hook "hook-pkg_resources.py"...
46670 INFO: Processing pre-safe import module hook win32com
46776 INFO: Excluding import '__main__'
46785 INFO: Removing import of __main__ from module pkg_resources
46785 INFO: Loading module hook "hook-pydoc.py"...
46785 INFO: Loading module hook "hook-PyQt5.py"...
我已经为此苦苦挣扎了两天。我也使用pyinstaller阅读了有关.exe文件的其他论坛,但找不到任何答案。如果有人可以提供帮助,我将不胜感激:)
谢谢