Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: DLL load failed while importing _pageparser: 找不到指定的模块。 #5

Open
Ant1816 opened this issue Oct 24, 2024 · 6 comments
Assignees

Comments

@Ant1816
Copy link
Contributor

Ant1816 commented Oct 24, 2024

image

我手动安装的模块至.venv\Lib\site-packages\maimai-updater-master pyproject.toml中已经添加模块名 venv正常激活 go env -w CGO_ENABLED=1 gcc已经安装 gopy编译没有明显错误 但是启动bot时报错如上 gopy编译输出如下:

image

一开始是go env -w CGO_ENABLED=0的 但是会出现和 #3 中下图一样的报错
image

求解答

@Dreamail Dreamail self-assigned this Nov 27, 2024
@Dreamail
Copy link
Owner

Sorry for delayed reply.
请检查一下目标目录下是否有编译成果

@Ant1816
Copy link
Contributor Author

Ant1816 commented Nov 27, 2024

你好 请问编译结果是 _pageparser.cp312-win_amd64.pyd 嘛 放入虚拟环境的模块目录还是重命名呢 我直接启动bot会报上面的错

@Ant1816
Copy link
Contributor Author

Ant1816 commented Nov 27, 2024

你好 上面的问题解决了 插件导入成功 但是在bot开始运行时 它报alembic.script.revision.ResolutionError: No such revision or branch '486a6e0eed5b'和alembic.util.exc.CommandError: Can't locate revision identified by '486a6e0eed5b'然后直接终止了bot运行 试过只激活单个插件来避免插件冲突的情况 但是还是同样的错误

想问下是不是迁移数据库没有改名字还是其他错误

  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\alembic\script\base.py", line 254, in _catch_revision_errors
    yield
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\alembic\script\base.py", line 317, in get_revisions
    self.revision_map.get_revisions(id_),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\alembic\script\revision.py", line 542, in get_revisions    return sum([self.get_revisions(id_elem) for id_elem in id_], ())
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\alembic\script\revision.py", line 565, in get_revisions    return tuple(
           ^^^^^^
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\alembic\script\revision.py", line 566, in <genexpr>
    self._revision_for_ident(rev_id, branch_label)
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\alembic\script\revision.py", line 637, in _revision_for_ident
    raise ResolutionError(
alembic.script.revision.ResolutionError: No such revision or branch '486a6e0eed5b'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\starlette\routing.py", line 693, in lifespan
    async with self.lifespan_context(app) as maybe_state:
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\nonebot\drivers\fastapi.py", line 153, in _lifespan_manager
    await self._lifespan.startup()
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\nonebot\internal\driver\_lifespan.py", line 42, in startup
    await self._run_lifespan_func(self._startup_funcs)
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\nonebot\internal\driver\_lifespan.py", line 36, in _run_lifespan_func
    await cast(ASYNC_LIFESPAN_FUNC, func)()
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\nonebot_plugin_orm\__init__.py", line 84, in init_orm
    await greenlet_spawn(migrate.check, alembic_config)
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 201, in greenlet_spawn
    result = context.throw(*sys.exc_info())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\nonebot_plugin_orm\migrate.py", line 567, in check
    script.run_env()
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\alembic\script\base.py", line 586, in run_env
    util.load_python_file(self.dir, "env.py")
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\alembic\util\pyfiles.py", line 95, in load_python_file
    module = load_module_py(module_id, path)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\alembic\util\pyfiles.py", line 113, in load_module_py
    spec.loader.exec_module(module)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\nonebot_plugin_orm\templates\generic\env.py", line 90, in <module>
    await_only(coro)
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 132, in await_only
    return current.parent.switch(awaitable)  # type: ignore[no-any-return,attr-defined] # noqa: E501
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 196, in greenlet_spawn
    value = await result
            ^^^^^^^^^^^^
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\nonebot_plugin_orm\templates\generic\env.py", line 79, in run_migrations_online
    await connection.run_sync(do_run_migrations)
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\sqlalchemy\ext\asyncio\engine.py", line 886, in run_sync
    return await greenlet_spawn(
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 203, in greenlet_spawn
    result = context.switch(value)
             ^^^^^^^^^^^^^^^^^^^^^
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\nonebot_plugin_orm\templates\generic\env.py", line 69, in do_run_migrations
    context.run_migrations()
  File "<string>", line 8, in run_migrations
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\alembic\runtime\environment.py", line 946, in run_migrations
    self.get_context().run_migrations(**kw)
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\alembic\runtime\migration.py", line 616, in run_migrations
    for step in self._migrations_fn(heads, self):
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\nonebot_plugin_orm\migrate.py", line 552, in retrieve_migrations
    if set(script.get_revisions(rev)) != set(script.get_revisions("heads")):
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\alembic\script\base.py", line 314, in get_revisions
    with self._catch_revision_errors():
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "C:\QQBot\nonebot\Ant1Bot_selfuse\.venv\Lib\site-packages\alembic\script\base.py", line 286, in _catch_revision_errors
    raise util.CommandError(resolution) from re
alembic.util.exc.CommandError: Can't locate revision identified by '486a6e0eed5b'

11-28 00:32:34 [ERROR] uvicorn | Application startup failed. Exiting.
停止重载监视```

@Ant1816
Copy link
Contributor Author

Ant1816 commented Nov 27, 2024

orm配置项改为alembic_startup_check=false不检测可加载插件 不过为什么更新了以后b15会少个几分呢?(疑惑

@Ant1816
Copy link
Contributor Author

Ant1816 commented Dec 4, 2024

目前分数上传没有问题 但是sync状态无法同步

@Dreamail
Copy link
Owner

Dreamail commented Dec 5, 2024

目前分数上传没有问题 但是sync状态无法同步

这个是解析器没有适配新版本的问题,从2024更新开始就这样了,还没时间去修orz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants