如何将python的项目部署到其他没有安装python环境的电脑

首先安装pyinstaller

命令pip3 install pyinstaller

到项目要运行的代码的那个.py档案(例如testPyinstaller.py),右键copy path,

(例如我的是D:\workspaceForPy\testPyinstaller\.idea\testPyinstaller.py)

到项目目录(idea右键show in explorer)

在cmd窗口运行 pyinstaller D:\workspaceForPy\testPyinstaller\.idea\testPyinstaller.py

然后项目目录里就有一个dist的文件夹,里面有一个testPyinstaller的文件夹,将这个文件夹压缩后,拿到其他电脑,解压缩后运行里面的testPyinstaller.exe

猜你喜欢

转载自blog.csdn.net/howard789/article/details/83585873
今日推荐