I've successfully installed pygame on my computer. When I type "import pygame" there is no error so that means that pygame is installed on my laptop. But, when I type the same thing on Pycharm, I get the following error:
ModuleNotFoundError: No module named 'pygame'
I have initialized pygame, so that's not the problem. I've also tried to install pygame from pycharm and I get this error every time I try to install it:
I've tried everything. The interpreter is correct, too. How can I proceed?
Probably you're using two different python interpreters on your pycharm and on your terminal.
Please,
check the python version on the terminal by python3 --version
And then go to pycharm -> file -> settings -> project -> project interpreter
and check if both python are the same.
sudo easy_install-3.8 pygame
(This will install the dependencies.)
sudo pip3 install pygame
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.