cx_Freeze.exception.ConfigError: cannot find file named C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\Python.Runtime.dll

Я написал код на Python PyGame, и хочу этот код скомпилировать в exe при помощи cx_Freeze

у меня возникает ошибка cx_Freeze.exception.ConfigError: cannot find file/directory named C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\Python.Runtime.dll

вот код example.py (исполняемый файл)

import pygame as pg
import re

blue = (0, 0, 255)
skyblue = (0, 186, 255)

pg.init()
pg.display.set_caption('Ферма "Бурка"')
screen = pg.display.set_mode((520, 620))
clock = pg.time.Clock()

gameover = False
while not gameover:
    clock.tick(150)
    for e in pg.event.get():
        if e.type == pg.QUIT:
            gameover = True
        elif e.type == pg.KEYDOWN:
            if e.key == pg.K_q:
                gameover = True
                
    screen.fill((30, 30, 30))
    
    pg.draw.rect(screen, skyblue, [100, 100, 320, 420], 0, 40)
    pg.draw.rect(screen, blue, [100, 100, 320, 420], 10, 40)

    pg.display.flip()

вот файл setup.py

from cx_Freeze import setup, Executable

# Dependencies are automatically detected, but it might need
# fine tuning.
build_options = {
    'packages': [],
    'excludes': [],
    'include_files': [],
    'includes': ['pygame', 're'],
    'zip_include_packages': ['pygame'],  # (1)   
    "include_msvcr": True,
    'build_exe': 'game', 
}

import sys
base = 'Win32GUI' if sys.platform=='win32' else None

executables = [
    Executable('example.py', base=base)
]

setup(name='PyGame',
      version = '0.0.1',
      description = 'This is a game',
      options = {'build_exe': build_options},
      executables = executables)

Что у меня не так? Помогите, пожалуйста?


Ответы (0 шт):