【发布时间】:2020-04-08 13:09:39
【问题描述】:
我正在尝试使用 cx_Freeze 作为将 .py 转换为 .exe (auto-py-to-exe) 的常用应用程序的替代方案。当我在 cmd 中运行它时,我得到:
C:\WINDOWS\system32>cxfreeze-quickstart
Project name: FE
Version [1.0]: 1.0
Description: File Edit and more!!!
Python file to make executable from: File Create.py
Executable file name [File Create]: FileCreateExe
(C)onsole application, (G)UI application, or (S)ervice [C]: C
Save setup script to [setup.py]: C:\Users\tom\Documents\python\_Thiswill createfiles_
Overwrite C:\Users\tom\Documents\python\_Thiswillcreatefiles_ [n]? yes
Traceback (most recent call last):
File "c:\users\tom\appdata\local\programs\python\python38-32\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\tom\appdata\local\programs\python\python38-32\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\tom\AppData\Local\Programs\Python\Python38-32\scripts\cxfreeze-quickstart.exe\__main__.py", line 7, in <module>
File "c:\users\tom\appdata\local\programs\python\python38-32\lib\site-packages\cx_Freeze\setupwriter.py", line 101, in main
writer.Write()
File "c:\users\tom\appdata\local\programs\python\python38-32\lib\site-packages\cx_Freeze\setupwriter.py", line 64, in Write
output = open(self.setupFileName, "w")
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\tom\\Documents\\python\\_This will create files_'
如您所见,我以管理员身份运行命令提示符,因为在正常运行时遇到了同样的错误。我能做些什么来解决这个错误? PermissionError: [Errno 13] Permission denied: 'C:\\Users\\tom\\Documents\\python\\_This will create files_'。我找不到任何其他解释如何解决此问题的网站。为什么会出现这个错误?请问我可以帮忙...????????????
【问题讨论】:
-
@PNX 你能提供文件名的正确例子吗?我的意思是,为什么要让 python 文件从
File Create.py和可执行文件名 [File Create] 作为File Create Executable执行?另外,你可以有一个没有空格的文件夹来保存吗?C:\Users\tom\Documents\python\_This will create files_? -
我更新了@NagarajTantri 的问题。我希望这就是你的意思?
标签: python cmd exe cx-freeze pypi