[英]Python 3.10 won't import modules
我正在 python 中开发一个基本的 discord 机器人,所以在安装 discord.py 之后,我使用import discord
开始代码。 The discord module is there, and when typing out import discord
it will even autofill discord, and trying to install discord again just says that the 'requirement is already satisfied.' 我的两个设备(Windows 10 PC 和 Macbook)都是这种情况。 在我的 PC 上运行它时,它运行得很好,但是在我的 macbook 上运行它时,我得到ModuleNotFoundError: No module named 'Discord'
。 pygame 和其他模块也可能发生完全相同的事情。 我怎样才能解决这个问题?
py -3.10 -m pip install discord
以安装在 python 3.10 中。 通过pip -V
检查版本,默认情况下必须使用 python 3.9。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.