简体   繁体   中英

Python 3.10 won't import modules

I'm working on a basic discord bot in python, so after installing discord.py I start the code with 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.' This is the case for both my devices (Windows 10 PC and a Macbook). When running it on my PC it runs perfectly, but when running it on my macbook I get ModuleNotFoundError: No module named 'Discord' . The exact same thing happens with pygame, and probably other modules. How can I fix this?

If you have 2 versions the try py -3.10 -m pip install discord to install in python 3.10. Check the version by pip -V it must be using python 3.9 by default.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM