Pyinstaller无法识别为内部或外部命令

我试图pyinstaller在cmd中使用,但收到错误:

C:\Users\username>pyinstaller

'pyinstaller' is not recognized as an internal or external command,

operable program or batch file.

C:\Users\username>

当我在python的 文件夹中使用此命令时,它可以正常工作:

C:\Users\username\AppData\Local\Programs\Python\Python36-32\Scripts>pyinstaller

usage: pyinstaller [-h] [-v] [-D] [-F] [--specpath DIR] [-n NAME]

[--add-data <SRC;DEST or SRC:DEST>]

[--add-binary <SRC;DEST or SRC:DEST>] [-p DIR]

[--hidden-import MODULENAME]

[--additional-hooks-dir HOOKSPATH]

[--runtime-hook RUNTIME_HOOKS] [--exclude-module EXCLUDES]

[--key KEY] [-d] [-s] [--noupx] [-c] [-w]

[-i <FILE.ico or FILE.exe,ID or FILE.icns>]

[--version-file FILE] [-m <FILE or XML>] [-r RESOURCE]

[--uac-admin] [--uac-uiaccess] [--win-private-assemblies]

[--win-no-prefer-redirects]

[--osx-bundle-identifier BUNDLE_IDENTIFIER]

[--distpath DIR] [--workpath WORKPATH] [-y]

[--upx-dir UPX_DIR] [-a] [--clean] [--log-level LEVEL]

[--upx UPX]

scriptname [scriptname ...]

pyinstaller: error: the following arguments are required: scriptname

C:\Users\username\AppData\Local\Programs\Python\Python36-32\Scripts>

如何解决呢?

回答:

你必须修改PATH

ENVIRON包括C:\Users\username\AppData\Local\Programs\Python\Python36-32\Scripts>

,如果你不知道如何做到这一点看这里

好运气

以上是 Pyinstaller无法识别为内部或外部命令 的全部内容, 来源链接: utcz.com/qa/434630.html

回到顶部