使用pyinstaller 对py脚本进行打包(生成linux可执行文件)
时间:2022-04-03 08:56
需求1:打包成Linux上可执行程序
a. 先下载pyinstaller程序,我当前下载的是PyInstaller-2.1的版本
进行如下操作:
pythoner@pythoner-virtual-machine:~/PyInstaller-2.1$ sudo python2.7 setup.py
install
pythoner@pythoner-virtual-machine:~/PyInstaller-2.1$ pwd
/home/pythoner/PyInstaller-2.1
#生成一个单文件可执行的spec文件
pythoner@pythoner-virtual-machine:~/PyInstaller-2.1$ ./utils/makespec.py --onefile ~/05.py wrote /home/pythoner/PyInstaller-2.1/05/05.spec now run pyinstaller.py to build the executable
#将该spec文件进行构建,生成一个独立的可执行文件
#这个文件在
/home/pythoner/PyInstaller-2.1/utils下面
使用pyinstaller 对py脚本进行打包(生成linux可执行文件),布布扣,bubuko.com