gpt4 book ai didi

python - Pyinstaller 未构建,因为 USS.jtx 的权限被拒绝

转载 作者:行者123 更新时间:2023-12-05 06:13:44 25 4
gpt4 key购买 nike

在 Windows 上使用 pyinstaller (pyinstaller --onefile main.py --name pbot.exe) 时出现以下错误:

329097 INFO: checking PKG
329097 INFO: Building PKG because PKG-00.toc is non existent
329099 INFO: Building PKG (CArchive) PKG-00.pkg
Cannot find ('nltk_data\AppData\Local\Comms\UnistoreDB\USS.jtx', 'C:\Users\adwaith\AppData\Local\Comms\UnistoreDB\USS.jtx', 1, 'x')
Traceback (most recent call last):
File "c:\users\adwaith\anaconda3\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\adwaith\anaconda3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\adwaith\anaconda3\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
File "c:\users\adwaith\anaconda3\lib\site-packages\PyInstaller\__main__.py", line 114, in run
run_build(pyi_config, spec_file, **vars(args))
File "c:\users\adwaith\anaconda3\lib\site-packages\PyInstaller\__main__.py", line 65, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:\users\adwaith\anaconda3\lib\site-packages\PyInstaller\building\build_main.py", line 734, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "c:\users\adwaith\anaconda3\lib\site-packages\PyInstaller\building\build_main.py", line 681, in build
exec(code, spec_namespace)
File "C:\Users\adwaith\Documents\pbot_win\pbot.spec", line 20, in <module>
exe = EXE(pyz,
File "c:\users\adwaith\anaconda3\lib\site-packages\PyInstaller\building\api.py", line 433, in __init__
self.pkg = PKG(self.toc, cdict=kwargs.get('cdict', None),
File "c:\users\adwaith\anaconda3\lib\site-packages\PyInstaller\building\api.py", line 199, in __init__
self.__postinit__()
File "c:\users\adwaith\anaconda3\lib\site-packages\PyInstaller\building\datastruct.py", line 160, in __postinit__
self.assemble()
File "c:\users\adwaith\anaconda3\lib\site-packages\PyInstaller\building\api.py", line 283, in assemble
archive = CArchiveWriter(self.name, srctoc + mytoc,
File "c:\users\adwaith\anaconda3\lib\site-packages\PyInstaller\archive\writers.py", line 336, in __init__
super(CArchiveWriter, self).__init__(archive_path, logical_toc)
File "c:\users\adwaith\anaconda3\lib\site-packages\PyInstaller\archive\writers.py", line 63, in __init__
self._add_from_table_of_contents(logical_toc)
File "c:\users\adwaith\anaconda3\lib\site-packages\PyInstaller\archive\writers.py", line 88, in _add_from_table_of_contents
self.add(toc_entry) # The guts of the archive.
File "c:\users\adwaith\anaconda3\lib\site-packages\PyInstaller\archive\writers.py", line 383, in add
fh = open(pathnm, 'rb')
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\adwaith\\AppData\\Local\\Comms\\UnistoreDB\\USS.jtx'

我已检查我的机器上是否存在该位置和 USS.jtx 文件。此外,我尝试搜索 USS.jtx 文件,但它一直出现在 git 的上下文中。我有一个 Github 桌面,所以我想也许从 git repo 内部使用 pyinstaller 会导致问题。然后我将整个存储库复制到我计算机上的另一个位置,但问题仍然存在。

最佳答案

我通常不是 Windows 用户,但我在 Linkedin 上看到了您关于此的帖子。

在我看来,该文件存在,但您没有读取它的权限。看看this article并确保您有权读取该文件。

检查这一点的一种快速而肮脏的方法是尝试在记事本或 Windows 中调用的任何基本文本编辑器中打开文件。

如果记事本在尝试打开文件时出错,那么您需要修复权限。如果记事本可以在不更改任何权限的情况下打开它,那么您运行 pyinstaller 的方式有些奇怪。

关于python - Pyinstaller 未构建,因为 USS.jtx 的权限被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63165743/

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