你好,我目前正在用 python 制作一个不和谐的机器人,我收到这些错误:Click to see photo
import coloredlogs, logging
import discord
from discord.ext import commands
from motor.motor_asyncio import AsyncIOMotorClient
这是我运行 python bot.py 时的错误:
Traceback (most recent call last):
File "C:\Users\%user%\Desktop\Omicron-Entetie\bot.py", line 4, in <module>
import coloredlogs, logging
File "C:\Users\%user%\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\coloredlogs\__init__.py", line 212, in <module>
from humanfriendly.compat import coerce_string, is_string, on_windows
ImportError: cannot import name 'on_windows' from 'humanfriendly.compat' (C:\Users\%user%\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\humanfriendly\compat.py)
答案 0 :(得分:0)
我建议您尝试检查是否实际安装了附加组件。打开命令提示符并输入“pip install (addon)”
如果这不起作用并且命令提示符给您一个错误,请尝试:py -m pip install(无论您需要安装什么)。
如果这也不起作用,请确保您已导入所有附加组件。