【发布时间】:2022-01-16 23:05:53
【问题描述】:
我正在尝试在 repl.it 上托管一个机器人,当我尝试运行该机器人时,会显示以下错误消息:
File "main.py", line 2, in <module>
import discord
ModuleNotFoundError: No module named 'discord'
这对我来说似乎很奇怪,因为我的代码在我上次尝试运行它时运行得非常好。
我做了一些进一步的调查,发现discord.py有一个名为aiohttp的依赖,所以我尝试自己安装包,然后发生了这种情况:
Using version ^3.8.1 for aiohttp
Updating dependencies
Resolving dependencies...
SolverProblemError
Because discord.py (1.7.3) depends on aiohttp (>=3.6.0,<3.8.0)
and no versions of discord.py match >1.7.3,<2.0.0, discord.py (>=1.7.3,<2.0.0) requires aiohttp (>=3.6.0,<3.8.0).
So, because basically-another-discordpy-bot depends on both discord.py (^1.7.3) and aiohttp (^3.8.1), version solving failed.
at /opt/virtualenvs/python3/lib/python3.8/site-packages/poetry/puzzle/solver.py:241 in _solve
237│ packages = result.packages
238│ except OverrideNeeded as e:
239│ return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
240│ except SolveFailure as e:
→ 241│ raise SolverProblemError(e)
242│
243│ results = dict(
244│ depth_first_search(
245│ PackageNode(self._package, packages), aggregate_package_nodes
exit status 1
Replit: Package operation failed.
这里发生了什么,我该如何解决?
【问题讨论】:
标签: python discord discord.py repl.it