在Windows 裡升級原本的 Python 3.7 到 Python 3.8 後,pyinstaller 指令不見了。
使用下面的指令,先檢查path 設定是否正確:
o display the current path in Windows the command is echo %path%
and in other systems, echo $PATH
.
似乎正確,在移除 python 3.7 之後,需要手動修改 %path% 的值,把\Program Files\Python3.7\ 和 \Program Files\Python3.7\Scripts\ 目錄手動刪除。
試了很多次 pip uninstall PyInstaller 和 pip install PyInstaller 後,指令還是沒有跑出來,官方文件寫這樣子:
https://pyinstaller.readthedocs.io/en/stable/installation.html#installing-in-windows
If you do not perform a complete installation (installing via
pip
or executingsetup.py
), these commands will not be installed as commands. However, you can still execute all the functions documented below by running Python scripts found in the distribution folder. The equivalent of thepyinstaller
command ispyinstaller-folder/pyinstaller.py
. The other commands are found inpyinstaller-folder/cliutils/
with meaningful names (makespec.py
, etc.)
看完,幫助不大。Max最後的解法是把 pyinstaller 的指令修改為:
python -m PyInstaller myscript.py