【python虚拟环境使用Auto-Py-to-Exe】

本文介绍了如何在Python虚拟环境中安装必要的包,如PySide2或PyQt5,然后利用Auto-Py-to-Exe将Python脚本转换为可执行文件exe。详细步骤包括创建虚拟环境、安装包、使用转换工具,并解释了转换过程中添加文件和目录的选项。通过这种方法,可以更轻松地处理项目的依赖文件并生成最终的exe程序。
摘要由CSDN通过智能技术生成

创建虚拟环境安装相应的包

首先打开cmd创建虚拟环境

conda create --name pyside2 python=3.9

进入虚拟环境

conda activate pyside2


安装相应的包,pyside2或者pyqt5等等。。。
最后安装auto-py-to-exe

pip install auto-py-to-exe

使用auto-py-to-exe

虚拟环境下输入auto-py-to-exe
在这里插入图片描述
然后跳出这个界面
在这里插入图片描述
附加文件说明:

ERROR: Exception: Traceback (most recent call last): File "c:\program files\python\lib\shutil.py", line 788, in move os.rename(src, real_dst) PermissionError: [WinError 5] 拒绝访问。: 'c:\\program files\\python\\lib\\site-packages\\flask-1.1.2.dist-info\\' -> 'C:\\Users\\弦引\\AppData\\Local\\Temp\\pip-uninstall-0g0yzsps' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\弦引\AppData\Roaming\Python\Python38\site-packages\pip\_internal\cli\base_command.py", line 180, in exc_logging_wrapper status = run_func(*args) File "C:\Users\弦引\AppData\Roaming\Python\Python38\site-packages\pip\_internal\commands\uninstall.py", line 105, in run uninstall_pathset = req.uninstall( File "C:\Users\弦引\AppData\Roaming\Python\Python38\site-packages\pip\_internal\req\req_install.py", line 687, in uninstall uninstalled_pathset.remove(auto_confirm, verbose) File "C:\Users\弦引\AppData\Roaming\Python\Python38\site-packages\pip\_internal\req\req_uninstall.py", line 381, in remove moved.stash(path) File "C:\Users\弦引\AppData\Roaming\Python\Python38\site-packages\pip\_internal\req\req_uninstall.py", line 272, in stash renames(path, new_path) File "C:\Users\弦引\AppData\Roaming\Python\Python38\site-packages\pip\_internal\utils\misc.py", line 318, in renames shutil.move(old, new) File "c:\program files\python\lib\shutil.py", line 800, in move rmtree(src) File "c:\program files\python\lib\shutil.py", line 737, in rmtree return _rmtree_unsafe(path, onerror) File "c:\program files\python\lib\shutil.py", line 615, in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) File "c:\program files\python\lib\shutil.py", line 613, in _rmtree_unsafe os.unlink(fullname) PermissionError: [WinError 5] 拒绝访问。: 'c:\\program files\\python\\lib\\site-packages\\flask-1.1.2.dist-info\\entry_points.txt'
07-22
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值