python打包成exe 明明存在文件却说不存在_pyinstaller说该文件已经存在,但它不存在...

好的,我正在尝试将一个小的python脚本制作成一个exe文件,我正在使用pyinstaller。(我的命令是

pyinstaller.exe --windowed --icon=pics\icon.ico -F --onefile main.py

)我已经了解了如何使用pyinstaller,它在我制作这个python程序的早期版本之前就已经工作过了。现在不行了,我不知道为什么。它的意思是,它试图创建的文件已经存在,但它没有(我已经检查过),它给了我这个错误:

765 INFO: PyInstaller: 3.4

765 INFO: Python: 3.7.1

765 INFO: Platform: Windows-10-10.0.17134-SP0

Traceback (most recent call last):

File "C:\Users\username\AppData\Local\Programs\Python\Python37\Scripts\pyinstaller-script.py", line 11, in

load_entry_point('pyinstaller==3.4', 'console_scripts', 'pyinstaller')()

File "c:\users\username\appdata\local\programs\python\python37\lib\site-packages\pyinstaller-3.4-py3.7.egg\PyInstaller\__main__.py", line 109, in run

spec_file = run_makespec(**vars(args))

File "c:\users\username\appdata\local\programs\python\python37\lib\site-packages\pyinstaller-3.4-py3.7.egg\PyInstaller\__main__.py", line 56, in run_makespec

spec_file = PyInstaller.building.makespec.main(filenames, **opts)

File "c:\users\username\appdata\local\programs\python\python37\lib\site-packages\pyinstaller-3.4-py3.7.egg\PyInstaller\building\makespec.py", line 331, in main

os.makedirs(specpath)

File "c:\users\username\appdata\local\programs\python\python37\lib\os.py", line 221, in makedirs

mkdir(name, mode)

FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\\Users\\username\\OneDrive\\Documents\\Game Center'

(以前做过,但那次,我试图制作的文件已经存在了。我删除了文件,再试了一次,一切正常。)

感谢您的帮助。谢谢!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值