ImportError: DLL load failed while importing _pydantic_core: Не найдена указанная процедура

Написал код на питон по тутору с ютуба, переписал все правильно, но выдает ошибку:

Traceback (most recent call last):
  File "C:/clicker/app.py", line 48, in <module>
    ft.app(target=main, view=ft.WEB_BROWSER)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\flet_runtime\app.py", line 70, in app
    return asyncio.run(
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\asyncio\runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 612, in run_until_complete
    return future.result()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\flet_runtime\app.py", line 158, in app_async
    else await __run_web_server(
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\flet_runtime\app.py", line 281, in __run_web_server
    from flet.fastapi.serve_fastapi_web_app import serve_fastapi_web_app
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\flet\fastapi\__init__.py", line 1, in <module>
    from flet.fastapi.app import app
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\flet\fastapi\app.py", line 5, in <module>
    from fastapi import Request, WebSocket
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\fastapi\__init__.py", line 7, in <module>
    from .applications import FastAPI as FastAPI
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\fastapi\applications.py", line 16, in <module>
    from fastapi import routing
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\fastapi\routing.py", line 22, in <module>
    from fastapi import params
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\fastapi\params.py", line 5, in <module>
    from fastapi.openapi.models import Example
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\fastapi\openapi\models.py", line 4, in <module>
    from fastapi._compat import (
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\fastapi\_compat.py", line 20, in <module>
    from fastapi.exceptions import RequestErrorModel
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\fastapi\exceptions.py", line 3, in <module>
    from pydantic import BaseModel, create_model
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\pydantic\__init__.py", line 404, in __getattr__
    module = import_module(module_name, package=package)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\pydantic\main.py", line 27, in <module>
    import pydantic_core
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\pydantic_core\__init__.py", line 6, in <module>
    from ._pydantic_core import (
ImportError: DLL load failed while importing _pydantic_core: Не найдена указанная процедура.
>>> 

Вот код:

import flet as ft

async def main(page: ft.Page) -> None:
    page.title = "Mandarin Clicker"
    page.theme_mode = ft.ThemeMode.DARK
    page.bgcolor = "#141221"
    page.vertical_alignment = ft.MainAxisAlignment.CENTER
    page.horizontal_alignment = ft.CrossAxisAlignment.CENTER
    page.fonts = {"21-font": "fonts/21-font.otf"}
    page.theme = ft.Theme(font_family="21-font")

    async def score_up(event: ft.ContainerTapEvent) -> None:
        score.value = str(int(score.value) + 1)
        await score.update_async()

    score = ft.Text(value="0", size=100, data=0)
    score_counter = ft.Text(
        size=50, animate_opacity=ft.Animation(duration=600, curve=ft.AnimationCurve.BOUNCE_IN)
    )
    image = ft.Image(
        src="bitoc.png",
        fit=ft.ImageFit.CONTAIN,
        animate_scale=ft.Animation(duration=600, curve=ft.AnimationCurve.EASE)
    )
    progress_bar = ft.ProgressBar(
        value=0,
        width=page.window_width - 100,
        bar_height=20,
        color="#ff8b1f",
        bgcolor="#bf6524"
    )

    # Adding elements to the page
    await page.add_async(
        score,
        ft.Container(
            content=ft.Stack(controls=[image, score_counter]),
            on_click=score_up,
            margin=ft.Margin(0, 0, 0, 30)
        ),
        ft.Container(
            content=progress_bar,
            border_radius=ft.BorderRadius(10, 10, 10, 10)
        )
    )

if __name__ == "__main__":
    ft.app(target=main, view=ft.WEB_BROWSER)

Как исправить


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