python创建虚拟环境并打包exe
1.创建虚拟环境
1 python -m venv myenv # 通用命令
2.进入虚拟环境
1 myenv\Scripts\activate #激活虚拟环境
3.打包
1 pyinstaller -w -i "icon.ico" --onefile main.py #打包exe 需要安装pyinstaller
1 python -m venv myenv # 通用命令
1 myenv\Scripts\activate #激活虚拟环境
1 pyinstaller -w -i "icon.ico" --onefile main.py #打包exe 需要安装pyinstaller