python 2.7 脚本打包 exe

pip install pyinstaller

进入 C:/Python27/Scripts 目录  或者 添加 Scripts 的环境变量

pyinstaller -F xxxx.py # xxxxx 代表你要打包的py 脚本全路径

或者

python pyinstaller -F xxxx.py # xxxxx 代表你要打包的py 脚本全路径

 

如果遇到问题:

Traceback (most recent call last): File “”, line 1, in File

“c:\users\root\temp\pip-build-mus7vd\pyinstaller\setup.py”, line 63 file=sys.stderr)

^ SyntaxError: invalid syntax

 

解决方案:

Use this commands:

python.exe -m pip install pefile==2019.4.18
python.exe -m pip install pyinstaller==3.6

参考这里:

https://zsecurity.org/forums/topic/syntaxerror-invalid-syntax/

 

或者

Visit Pyinstaller Release History to view the version you would like to install (all versions from Python v3.6 down to v3.0 support Python 2)
pip install pyinstaller==3.5

参考这里 :https://stackoverflow.com/questions/63342345/cant-install-pyinstaller-at-ubuntu

 

posted @ 2022-08-04 15:04  lesten  阅读(437)  评论(0编辑  收藏  举报