PyInstaller-FileNotFoundError:没有这样的文件或目录:''

时间:2020-03-01 02:31:11

标签: python windows pyinstaller

我已经看到很多关于这个非常错误的代码的帖子,并且答案很多,但仍然无法解决我的问题。

我与其他所有职位的不同之处在于,我得到了以下内容:

317 INFO: Building PKG because PKG-00.toc is non existent
318 INFO: Building PKG (CArchive) PKG-00.pkg
Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\Christopher\Desktop\project\venv\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
  File "c:\users\christopher\desktop\project\venv\lib\site-packages\PyInstaller\__main__.py", line 114, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "c:\users\christopher\desktop\project\venv\lib\site-packages\PyInstaller\__main__.py", line 65, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "c:\users\christopher\desktop\project\venv\lib\site-packages\PyInstaller\building\build_main.py", line 729, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "c:\users\christopher\desktop\project\venv\lib\site-packages\PyInstaller\building\build_main.py", line 676, in build
    exec(code, spec_namespace)
  File "C:\Users\Christopher\Desktop\project\main.spec", line 20, in <module>
    exe = EXE(pyz,
  File "c:\users\christopher\desktop\project\venv\lib\site-packages\PyInstaller\building\api.py", line 433, in __init__
    self.pkg = PKG(self.toc, cdict=kwargs.get('cdict', None),
  File "c:\users\christopher\desktop\project\venv\lib\site-packages\PyInstaller\building\api.py", line 199, in __init__
    self.__postinit__()
  File "c:\users\christopher\desktop\project\venv\lib\site-packages\PyInstaller\building\datastruct.py", line 160, in __postinit__
    self.assemble()
  File "c:\users\christopher\desktop\project\venv\lib\site-packages\PyInstaller\building\api.py", line 259, in assemble
    fnm = checkCache(fnm, strip=self.strip_binaries,
  File "c:\users\christopher\desktop\project\venv\lib\site-packages\PyInstaller\building\utils.py", line 213, in checkCache
    digest = cacheDigest(fnm, redirects)
  File "c:\users\christopher\desktop\project\venv\lib\site-packages\PyInstaller\building\utils.py", line 358, in cacheDigest
    with open(fnm, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: ''

有问题的文件为”(完全没有文件)。我是python和PyInstaller的新手,对此我感到很困惑。

1 个答案:

答案 0 :(得分:3)

在CArchive步骤中,PyInstaller尝试捆绑Python DLL。这些名称的设置取决于版本,如果它是不受支持的python版本,PyInstaller将返回一个空字符串。这就是导致错误的原因。请使用python 3.5-3.7