简体   繁体   中英

Unable To Import Pygame After Pip Install

I installed pygame through pip. I know for a fact it is there, as I have seen the file labeled 'pygame' in the file explorer. However Python does not agree with me that it is certainly there.

What makes this odd is that i've installed pygame using pip before on a different user, it worked fine, and i did nothing differently this time.

import pygame Traceback (most recent call last): File "", line 1, in import pygame ModuleNotFoundError: No module named 'pygame'

Check your virtual environment. It seems that you are not using the environment where you have installed pygame. If you are using Anaconda, the environment is specified in parentheses. You can activate your environment using: conda activate <conda environment name here>

Hope this works!

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