【问题标题】:PyInstaller - FileNotFoundError: No such file or directory: ''PyInstaller - FileNotFoundError:没有这样的文件或目录:''
【发布时间】:2020-03-01 02:31:11
【问题描述】:

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

我与所有其他帖子的不同之处在于我得到以下内容:

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 的新手,对此我感到非常困惑。

【问题讨论】:

  • 你的文件名是英文的吗?也许这可能是个问题。我的第一个建议是卸载并重新安装 pyinstaller。它是许多 CS 问题的快速和最常见的解决方案:P
  • 更改名称并重新安装 PyInstaller。还是不行:(
  • Pyinstaller 适用于 Python 2.7、Python 3.5-Python 3.7
  • @CimimUxMaio 期望在接下来的两个版本 PyInstaller 4.0 和 4.1 中支持 python 3.8。不过,它可能会是后一个版本。请参阅 GitHub.com/PyInstaller/PyInstaller/issues/4311 了解详细信息并进行跟踪 - 您甚至可以将 GitHub 设置为在问题关闭时通知您。
  • @Legorooj 是的,我想,我也看了 pypi 和另一个我现在忘记了。

标签: python windows pyinstaller


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-10-19
    • 2021-06-24
    • 2022-10-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多