windows和Ubuntu各自生成Python程序操作方法
Windows步骤:(建议在外网的情况下完成)
一,在Windows安装Python
①https://www.python.org/downloads/windows/ 在官网中选择合适的版本进行下载
②https://blog.csdn.net/qq_44214671/article/details/113469811 按照流程进行下载
③https://blog.csdn.net/Z987421/article/details/131422753 安装pycharm
二,下载 pyinstaller :
pip install pyinstaller
pip install paramiko
三,生成exe程序
pyinstaller -F xxx.py
! 遇到的问题:
https://blog.csdn.net/pengmingjv/article/details/117535195
在使用pyinstaller生成exe,将编写完成的几个python文件封装成exe文件,但是出现了错误,提示Fatal error: PyInstaller does not include a pre-compiled bootloader for your platform. For more details and instructions how to build the bootloader see https://pyinstaller.readthedocs.io/en/stable/bootloader-building.html
经过查杀毒软件问题,要及时去杀毒软件进行恢复文件。发现是在Python3\Lib\site-packages\PyInstaller\bootloader目录中,缺少了runw.exe和runw_d.exe导致的的生成exe出现错误,是由于电脑上的杀毒软件在安装pyinstaller将这两个文件误删掉,因此可以按照如下步骤来进行修改。
l 方法:
第一步 关闭电脑杀毒软件
右键–退出
第二步 将以前安装的pyinstaller卸载掉
执行pip uninstall pyinstaller
第三步 重新安装pyinstaller
执行pip install pyinstaller
检查pyinstaller的目录
缺失的两个文件已经生成。
然后输入生成exe指令,验证是否可以成功生成。
在这里,是将多个文件一起合成
Ubuntu步骤:
一,安装Python
如:
①下载
https://www.python.org/downloads/
②解压安装
tar -xvzf Python3.5.9.tgz
./configure
cd Python3.5.9
sudo make
sudo make install
③测试
python3 -v
按(ctrl+d)退出
二,下载 pyinstaller :(如网络不好下载失败尝试换一下镜像源)
pip3 install pyinstaller
三,生成exe程序
pyinstaller -F xxx.py