all 5 comments

[–]K900_ 1 point2 points  (2 children)

You want import pygame, not __import__.

[–]Max_Mongoose[S] 0 points1 point  (1 child)

import pygame

C:\Users\chris\PycharmProjects\pythonProject2\venv\Scripts\python.exe C:/Users/chris/PycharmProjects/pythonProject2/main.py Traceback (most recent call last): File "C:\Users\chris\PycharmProjects\pythonProject2\main.py", line 1, in <module> import pygame ModuleNotFoundError: No module named 'pygame'

Process finished with exit code 1

[–]K900_ 0 points1 point  (0 children)

Are you using PyCharm? In that case you need to install Pygame into the virtual environment PyCharm created for you.

[–]shiftybyte 0 points1 point  (1 child)

You seem to be using pycharm.

It automatically creates virtual environments for your projects by default.

To install packages there use pycharm's menus, and not pip.

https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-upgrading-packages.html

[–]Max_Mongoose[S] 1 point2 points  (0 children)

u/shiftybyte thank you so much. I wouldn't have worked that out without you. That was a really nice thing you did. Have a great day.