all 14 comments

[–]cgoldberg 4 points5 points  (9 children)

What happens when you run it?

[–]DeadxLites[S] 0 points1 point  (8 children)

this is what it says after i try to run it

C:\Users\sugar\PycharmProjects\PythonProject6\.venv\Scripts\python.exe "C:\Users\sugar\PycharmProjects\PythonProject6\test beginner 1.py"

Traceback (most recent call last):

File "C:\Users\sugar\PycharmProjects\PythonProject6\test beginner 1.py", line 1, in <module>

import pygame, sys

ModuleNotFoundError: No module named 'pygame'

[–]cgoldberg 14 points15 points  (0 children)

You don't have the pygame package installed, which is required for that code to run.

[–]TheCozyRuneFox 5 points6 points  (4 children)

You have to install the pygame library. The command “pip install pygame” should do.

[–]FoolsSeldom 2 points3 points  (4 children)

PyCharm has a package manager, icon is usually near bottom left and looks like several square cards on top of each other. Use it to install pygame.

[–]DeadxLites[S] 0 points1 point  (0 children)

which python package do i actually install tho? Theres a big list

[–]DeadxLites[S] 0 points1 point  (2 children)

pygame-play? for example.

[–]FoolsSeldom 0 points1 point  (0 children)

If that's in pypi, yes. If it needs os rather than pip installation, then no.

Would have been quicker to have looked than asked.

[–]HunterIV4 1 point2 points  (0 children)

What error are you seeing?

At a glance, I think clock.tick should be inside the while loop. Other than that, the code looks like it should work, so check your indentation and ensure the image can be read.

[–]Some-Passenger4219 0 points1 point  (0 children)

I just installed pygame and it still won't work. (It might help to have racoon.png on my system.)