我正在重写原始帖子,因为在尝试了此处给我的建议后,PyInstaller仍然遇到相同的问题。
在Python和cmd线上观看视频时,我偶然发现了在cmd shell上编写python代码的过程,所以我觉得应该尝试一下,看看会发生什么,所以我明白了:
C:\Users\User1>python
"python" is not recognized as an internal or external command, operable program or batch file.
因此,我在PATH variable
中创建了一个Environment Variables
,然后再次尝试,便可以访问该外壳程序。
我还将PyInstaller的路径添加到PATH,再次尝试了PyInstaller,并获得了以下内容:
1)
C:\Users\User1>pyinstaller "test.py"
"pyinstaller" is not recognized as an internal or external command, operable program or batch file.
2)
C:\Users\User1\AppData\Local\Programs\Python\Python37\Lib\site-packages\Py
Installer>pyinstaller --onefile "C:\Users\User1\Desktop\test.py"
"pyinstaller" is not recognized as an internal or external command, operable
program or batch file.
这些是我添加到PATH的路径:C:\Users\User1\AppData\Local\Programs\Python\Python37;C:\Users\User1\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller
将PyInstaller目录作为支持
Directory of C:\Users\User1\AppData\Local\Programs\Python\Python37\Lib\s
ite-packages\PyInstaller>dir
16/09/2019 18:32 <DIR> .
16/09/2019 18:32 <DIR> ..
16/09/2019 18:32 <DIR> archive
16/09/2019 18:32 <DIR> bootloader
16/09/2019 18:32 <DIR> building
16/09/2019 18:31 33.914 compat.py
16/09/2019 18:31 1.630 config.py
16/09/2019 18:31 3.411 configure.py
16/09/2019 18:32 <DIR> depend
16/09/2019 18:31 456 exceptions.py
16/09/2019 18:32 <DIR> fake-modules
16/09/2019 18:32 <DIR> hooks
16/09/2019 18:32 <DIR> lib
16/09/2019 18:32 <DIR> loader
16/09/2019 18:31 1.554 log.py
16/09/2019 18:32 <DIR> utils
16/09/2019 18:31 3.085 __init__.py
16/09/2019 18:31 4.073 __main__.py
16/09/2019 18:32 <DIR> __pycache__
7 archivos 48.123 bytes
12 dirs 33.120.616.448 free bytes
关于cmd行为何执行python shell但不执行PyInstaller的任何想法?