Pyinstaller not building because permission denied to USS.jtx

Viewed 315

I am getting the following error when using the pyinstaller (pyinstaller --onefile main.py --name pbot.exe) on windows:

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'

I have checked that the location and the USS.jtx files exist on my machine. Also, I tried searching about USS.jtx file but it keeps showing up in the context of git. I do have a Github desktop, so I thought maybe using pyinstaller from inside the git repo is causing problems. I then copied the entire repo to another location on my computer, but the problem persists.

1 Answers

I'm not normally a Windows guy, but I saw your post on Linkedin about this.

It seems to me that the file exists, but you don't have permission to read it. Have a look at this article and ensure that you have permission to read the file.

A quick and dirty way to check this is to just try opening the file in notepad or whatever the basic text editor is called in Windows.

If notepad gives an error on trying to open the file, then you need to fix the permissions. If notepad can open it without any changes to the permissions, then you have some oddness in how you are running pyinstaller.

Related