PyInstaller: FileNotFoundError, создающий .exe - PullRequest
0 голосов
/ 07 мая 2020

Я начал изучать python несколько дней и go, ничего не зная об этом. Сегодня я написал свою первую программу, поэтому я хотел создать ее .exe. Я установил pip, virtualenv, pyinstaller и некоторые другие пакеты из CMD в выбранный мной каталог. Затем я активировал виртуальную среду и попробовал эту команду:

pyinstaller dice.py --onefile

, и вот результат:

72 INFO: PyInstaller: 3.6
72 INFO: Python: 3.8.2
73 INFO: Platform: Windows-10-10.0.18362-SP0
74 INFO: wrote C:\Users\Alessandra\Documents\python\dice.spec
76 INFO: UPX is not available.
77 INFO: Extending PYTHONPATH with paths
['C:\\Users\\Alessandra\\Documents\\python',
 'C:\\Users\\Alessandra\\Documents\\python']
78 INFO: checking Analysis
78 INFO: Building Analysis because Analysis-00.toc is non existent
78 INFO: Initializing module dependency graph...
81 INFO: Caching module graph hooks...
88 INFO: Analyzing base_library.zip ...
5116 INFO: Processing pre-find module path hook   distutils
5117 INFO: distutils: retargeting to non-venv dir 'C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\\lib'
6754 INFO: Caching module dependency graph...
6903 INFO: running Analysis Analysis-00.toc
6906 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by c:\users\alessandra\documents\python\env\scripts\python.exe
6922 INFO: Analyzing C:\Users\Alessandra\Documents\python\dice.py
6925 INFO: Processing module hooks...
6925 INFO: Loading module hook "hook-distutils.py"...
6927 INFO: Loading module hook "hook-encodings.py"...
8050 INFO: Loading module hook "hook-pydoc.py"...
8051 INFO: Loading module hook "hook-sysconfig.py"...
8053 INFO: Loading module hook "hook-xml.py"...
8297 INFO: Looking for ctypes DLLs
8300 INFO: Analyzing run-time hooks ...
8304 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
8313 INFO: Looking for dynamic libraries
8328 WARNING: lib not found: python38.dll dependency of C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\DLLs\select.pyd
8342 WARNING: lib not found: python38.dll dependency of C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\DLLs\_lzma.pyd
8362 WARNING: lib not found: python38.dll dependency of C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\DLLs\_bz2.pyd
8382 WARNING: lib not found: python38.dll dependency of C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\DLLs\pyexpat.pyd
8399 WARNING: lib not found: python38.dll dependency of C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\DLLs\_overlapped.pyd
8414 WARNING: lib not found: python38.dll dependency of C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\DLLs\_asyncio.pyd
8426 WARNING: lib not found: python38.dll dependency of C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\DLLs\_queue.pyd
8449 WARNING: lib not found: python38.dll dependency of C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\DLLs\_ssl.pyd
8467 WARNING: lib not found: python38.dll dependency of C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\DLLs\_hashlib.pyd
8487 WARNING: lib not found: python38.dll dependency of C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\DLLs\unicodedata.pyd
8513 WARNING: lib not found: python38.dll dependency of C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\DLLs\_decimal.pyd
8539 WARNING: lib not found: python38.dll dependency of C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\DLLs\_ctypes.pyd
8557 WARNING: lib not found: python38.dll dependency of C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\DLLs\_multiprocessing.pyd
8571 WARNING: lib not found: python38.dll dependency of C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\DLLs\_socket.pyd
8676 INFO: Looking for eggs
8676 INFO: Python library not in binary dependencies. Doing additional searching...
8682 INFO: Using Python library
8682 INFO: Found binding redirects:
[]
8687 INFO: Warnings written to C:\Users\Alessandra\Documents\python\build\dice\warn-dice.txt
8741 INFO: Graph cross-reference written to C:\Users\Alessandra\Documents\python\build\dice\xref-dice.html
8755 INFO: checking PYZ
8755 INFO: Building PYZ because PYZ-00.toc is non existent
8757 INFO: Building PYZ (ZlibArchive) C:\Users\Alessandra\Documents\python\build\dice\PYZ-00.pyz
9404 INFO: Building PYZ (ZlibArchive) C:\Users\Alessandra\Documents\python\build\dice\PYZ-00.pyz completed successfully.
9417 INFO: checking PKG
9418 INFO: Building PKG because PKG-00.toc is non existent
9419 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\Alessandra\Documents\python\env\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
  File "c:\users\alessandra\documents\python\env\lib\site-packages\PyInstaller\__main__.py", line 114, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "c:\users\alessandra\documents\python\env\lib\site-packages\PyInstaller\__main__.py", line 65, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "c:\users\alessandra\documents\python\env\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\alessandra\documents\python\env\lib\site-packages\PyInstaller\building\build_main.py", line 681, in build
    exec(code, spec_namespace)
  File "C:\Users\Alessandra\Documents\python\dice.spec", line 20, in <module>
    exe = EXE(pyz,
  File "c:\users\alessandra\documents\python\env\lib\site-packages\PyInstaller\building\api.py", line 433, in __init__
    self.pkg = PKG(self.toc, cdict=kwargs.get('cdict', None),
  File "c:\users\alessandra\documents\python\env\lib\site-packages\PyInstaller\building\api.py", line 199, in __init__
    self.__postinit__()
  File "c:\users\alessandra\documents\python\env\lib\site-packages\PyInstaller\building\datastruct.py", line 160, in __postinit__
    self.assemble()
  File "c:\users\alessandra\documents\python\env\lib\site-packages\PyInstaller\building\api.py", line 259, in assemble
    fnm = checkCache(fnm, strip=self.strip_binaries,
  File "c:\users\alessandra\documents\python\env\lib\site-packages\PyInstaller\building\utils.py", line 220, in checkCache
    digest = cacheDigest(fnm, redirects)
  File "c:\users\alessandra\documents\python\env\lib\site-packages\PyInstaller\building\utils.py", line 365, in cacheDigest
    with open(fnm, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: ''

Я не могу понять, в чем проблема, может кто-нибудь помочь? Спасибо

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...