gpt4 book ai didi

python - pyinstaller 权限被拒绝 : C:\Python\Scripts\build

转载 作者:行者123 更新时间:2023-12-01 02:28:18 24 4
gpt4 key购买 nike

当我尝试将 python 脚本构建为 exe 文件时,出现此错误。这是我的脚本:

from tkinter import *
import os
import tkinter.messagebox
root = Tk()
root.title('BTCLoot - Loot BTC from your home!')
logoutButton = Button(root, text='Logout')
logoutButton.grid(row=0, column=0, sticky=W)
balance = Label(text='Balance: N/A Sat.')
balance.grid(row=0, column=1, sticky=W)
root.geometry('600x250')
root.mainloop()

这是我在控制台中得到的:

C:\Python34\Scripts>pyinstaller btcloot.py build
109 INFO: PyInstaller: 3.3
109 INFO: Python: 3.6.2
109 INFO: Platform: Windows-8.1-6.3.9600-SP0
109 INFO: wrote C:\Python34\Scripts\btcloot.spec
109 INFO: UPX is not available.
109 INFO: Extending PYTHONPATH with paths
['C:\\Python34\\Scripts', 'C:\\Python34\\Scripts', 'C:\\Python34\\Scripts']
109 INFO: checking Analysis
109 INFO: Building Analysis because out00-Analysis.toc is non existent
109 INFO: Initializing module dependency graph...
109 INFO: Initializing module graph hooks...
125 INFO: Analyzing base_library.zip ...
5109 INFO: running Analysis out00-Analysis.toc
5109 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies o
inal executable
required by c:\python34\python.exe
6093 INFO: Caching module hooks...
6109 INFO: Analyzing C:\Python34\Scripts\btcloot.py
6328 INFO: Analyzing C:\Python34\Scripts\build
Traceback (most recent call last):
File "C:\Python34\Scripts\pyinstaller-script.py", line 11, in <module>
load_entry_point('PyInstaller==3.3', 'console_scripts', 'pyinstaller')()
File "c:\python34\lib\site-packages\PyInstaller\__main__.py", line 92, in r
run_build(pyi_config, spec_file, **vars(args))
File "c:\python34\lib\site-packages\PyInstaller\__main__.py", line 46, in r
build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:\python34\lib\site-packages\PyInstaller\building\build_main.py", li
791, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_bui
))
File "c:\python34\lib\site-packages\PyInstaller\building\build_main.py", li
737, in build
exec(text, spec_namespace)
File "<string>", line 16, in <module>
File "c:\python34\lib\site-packages\PyInstaller\building\build_main.py", li
213, in __init__
self.__postinit__()
File "c:\python34\lib\site-packages\PyInstaller\building\datastruct.py", li
161, in __postinit__
self.assemble()
File "c:\python34\lib\site-packages\PyInstaller\building\build_main.py", li
415, in assemble
priority_scripts.append(self.graph.run_script(script))
File "c:\python34\lib\site-packages\PyInstaller\depend\analysis.py", line 2
in run_script
return super(PyiModuleGraph, self).run_script(pathname, caller=caller)
File "c:\python34\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph
", line 1326, in run_script
with open(pathname, 'rb') as fp:
PermissionError: [Errno 13] Permission denied: 'C:\\Python34\\Scripts\\build'

C:\Python34\Scripts>pyinstaller btcloot.py build
103 INFO: PyInstaller: 3.3
104 INFO: Python: 3.6.2
104 INFO: Platform: Windows-8.1-6.3.9600-SP0
106 INFO: wrote C:\Python34\Scripts\btcloot.spec
107 INFO: UPX is not available.
109 INFO: Extending PYTHONPATH with paths
['C:\\Python34\\Scripts', 'C:\\Python34\\Scripts', 'C:\\Python34\\Scripts']
110 INFO: checking Analysis
110 INFO: Building Analysis because out00-Analysis.toc is non existent
110 INFO: Initializing module dependency graph...
113 INFO: Initializing module graph hooks...
116 INFO: Analyzing base_library.zip ...
5156 INFO: running Analysis out00-Analysis.toc
5156 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies o
inal executable
required by c:\python34\python.exe
6156 INFO: Caching module hooks...
6171 INFO: Analyzing C:\Python34\Scripts\btcloot.py
6406 INFO: Analyzing C:\Python34\Scripts\build
Traceback (most recent call last):
File "C:\Python34\Scripts\pyinstaller-script.py", line 11, in <module>
load_entry_point('PyInstaller==3.3', 'console_scripts', 'pyinstaller')()
File "c:\python34\lib\site-packages\PyInstaller\__main__.py", line 92, in r
run_build(pyi_config, spec_file, **vars(args))
File "c:\python34\lib\site-packages\PyInstaller\__main__.py", line 46, in r
build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:\python34\lib\site-packages\PyInstaller\building\build_main.py", li
791, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_bui
))
File "c:\python34\lib\site-packages\PyInstaller\building\build_main.py", li
737, in build
exec(text, spec_namespace)
File "<string>", line 16, in <module>
File "c:\python34\lib\site-packages\PyInstaller\building\build_main.py", li
213, in __init__
self.__postinit__()
File "c:\python34\lib\site-packages\PyInstaller\building\datastruct.py", li
161, in __postinit__
self.assemble()
File "c:\python34\lib\site-packages\PyInstaller\building\build_main.py", li
415, in assemble
priority_scripts.append(self.graph.run_script(script))
File "c:\python34\lib\site-packages\PyInstaller\depend\analysis.py", line 2
in run_script
return super(PyiModuleGraph, self).run_script(pathname, caller=caller)
File "c:\python34\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph
", line 1326, in run_script
with open(pathname, 'rb') as fp:
PermissionError: [Errno 13] Permission denied: 'C:\\Python34\\Scripts\\build'

有人可以帮助我吗?我是 pyinstaller 的新手。另外,当我尝试使用 py2exe 时,它​​不会为我编译。

最佳答案

我已经修复了它:

pyinstaller -F btcloot.py

关于python - pyinstaller 权限被拒绝 : C:\Python\Scripts\build,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47120125/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com