pyinstaller command not found

Posted in :

在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 executing setup.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 the pyinstaller command is pyinstaller-folder/pyinstaller.py. The other commands are found in pyinstaller-folder/cliutils/ with meaningful names (makespec.py, etc.)

看完,幫助不大。Max最後的解法是把 pyinstaller 的指令修改為:

python -m PyInstaller myscript.py

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *