我有一个桌面时钟项目,想要打包成exe,决定用PyInstaller来打包。
C:\Users\gino>pip list
Package Version
------------------------- ---------
altgraph 0.17.2
async-generator 1.10
attrs 21.4.0
certifi 2021.10.8
cffi 1.15.0
charset-normalizer 2.0.12
chromedriver 2.24.1
cryptography 36.0.1
future 0.18.2
h11 0.13.0
homebrew 0.2.5
idna 3.3
lxml 4.7.1
MouseInfo 0.1.3
outcome 1.1.0
pefile 2021.9.3
pip 22.1
PyAutoGUI 0.9.53
pycparser 2.21
pygal 3.0.0
PyGetWindow 0.0.9
pyinstaller 5.0.1 #在这里
pyinstaller-hooks-contrib 2022.4
PyMsgBox 1.0.9
pyOpenSSL 22.0.0
pyperclip 1.8.2
PyQt5 5.15.6
PyQt5-Qt5 5.15.2
PyQt5-sip 12.10.1
PyRect 0.2.0
PyScreeze 0.1.28
pytweening 1.0.4
pywin32 304
pywin32-ctypes 0.2.0
requests 2.27.1
selenium 4.1.0
sniffio 1.2.0
sortedcontainers 2.4.0
trio 0.19.0
trio-websocket 0.9.2
urllib3 1.26.8
wsproto 1.0.0
C:\Users\gino>pyinstaller
'pyinstaller' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
C:\Users\gino>cd c:\users\gino\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages
c:\Users\gino\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages>pyinstaller
'pyinstaller' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
程序找不到Pyinstaller,有两种可能
找到pyinstaller上面的Scripts文件夹,使用它的绝对路径使用命令。
把pyinstaller.exe的安装目录添加到环境变量PATH里。