Discord.ext.menus由于"Unknown location"而无法导入



当导入python库discord-ext-menus(在:https://github.com/Rapptz/discord-ext-menus找到)时,我得到一个错误

Traceback (most recent call last):
File "C:UsersvahinAppDataLocalProgramsPythonPython310libsite-packagesdiscordextcommandsbot.py", line 934, in _load_from_module_spec
spec.loader.exec_module(lib)  # type: ignore
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "C:UsersvahinPycharmProjectsMyDiscordBot v2.0My-Discord-BotcogsHelp.py", line 5, in <module>
from discord.ext import menus
ImportError: cannot import name 'menus' from 'discord.ext' (unknown location)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:UsersvahinAppDataLocalProgramsPythonPython310libsite-packagesdiscordclient.py", line 409, in _run_event
await coro(*args, **kwargs)
File "C:UsersvahinPycharmProjectsMyDiscordBot v2.0My-Discord-BotBotMain.py", line 27, in on_ready
await bot.load_extension(i)
File "C:UsersvahinAppDataLocalProgramsPythonPython310libsite-packagesdiscordextcommandsbot.py", line 1012, in load_extension
await self._load_from_module_spec(spec, name)
File "C:UsersvahinAppDataLocalProgramsPythonPython310libsite-packagesdiscordextcommandsbot.py", line 937, in _load_from_module_spec
raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.Help' raised an error: ImportError: cannot import name 'menus' from 'discord.ext' (unknown location)

我已经尝试重新安装库多次-但没有任何反应。

不使用discord.py安装菜单。要安装它,您需要在虚拟环境中运行python -m pip install -U git+https://github.com/Rapptz/discord-ext-menus

最新更新