Pyinstaller 说该文件已经存在,但它不存在
Pyinstaller says that file already exists, but it doesn't
好的,所以我正在尝试将一些 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 <module>
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'
(以前也这样做过,不过那次我尝试做DID的文件已经存在了,我把文件删了,再试一次,一切正常。)
任何帮助表示赞赏。谢谢!
我刚刚弄明白了。我不知道发生了什么变化,但它现在工作得很好。我只等了一个星期就回来了。我想上帝刚刚创造了一个奇迹!
好的,所以我正在尝试将一些 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 <module>
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'
(以前也这样做过,不过那次我尝试做DID的文件已经存在了,我把文件删了,再试一次,一切正常。) 任何帮助表示赞赏。谢谢!
我刚刚弄明白了。我不知道发生了什么变化,但它现在工作得很好。我只等了一个星期就回来了。我想上帝刚刚创造了一个奇迹!