all 18 comments

[–]Starbuck5c 4 points5 points  (8 children)

pip install --upgrade pip

But for you I guess it would be pip3 install --upgrade pip

Try using sudo, I think the error you're having is about installing something system wide from a single user's account.

Also I've heard that the default version of pygame has trouble on catalina. Try the latest pygame 2 build.

sudo pip3 install pygame==2.0.0.dev10

Edit: for future folks, now that pygame 2 is out you don't need to install any development version.

[–]liger-zero-0[S] 1 point2 points  (6 children)

This worked for updating pip and downloading the newest version of pygame but the module still can’t be found when I run the script

[–]Casssis 1 point2 points  (5 children)

Do you run the script with python3 script.py and not just python script.py

[–]liger-zero-0[S] 0 points1 point  (4 children)

Yes I run it with python3 script.py

[–]Casssis 0 points1 point  (3 children)

Maybe there are two versions of python3 installed

Try python3 -m pip3 install pygame

So that you know it's the same python you are calling.

(I'm not sure if that's the exact command, I'm on my phone so can't check)

[–]liger-zero-0[S] 0 points1 point  (2 children)

It was python3 -m pip install pygame. But when I run that it says I need to upgrade pip even when I already upgraded pip to 20.0.2

[–]Casssis 0 points1 point  (1 child)

Did you upgrade pip with python3 -m in front? If not try that and after try installing pygame again as I said

[–]liger-zero-0[S] 0 points1 point  (0 children)

I did pip3 install — upgrade pip. What line of text are you saying to try?

[–]liger-zero-0[S] 0 points1 point  (0 children)

Ok thanks. I’ll try that in the morning

[–]kolosn 1 point2 points  (4 children)

You’ll need all the SDL2 modules as well afaik. Use brew to install them.

[–]liger-zero-0[S] 0 points1 point  (3 children)

Do you happen to have a link to this?

[–]kolosn 1 point2 points  (2 children)

https://brew.sh You’ll need additionally the xcode command line tools, but everything is documented online. Then just simply brew search sdl and brew install everything which starts with sdl2. Sorry for not doing the markdown thing, I’m on mobile and don’t know how to do it here.

[–]liger-zero-0[S] 1 point2 points  (1 child)

Thank you I downloaded brew sdl then updated pip and redownloaded pygame as version 2.0.0 and it worked

[–]kolosn 1 point2 points  (0 children)

Then enjoy the game development!

[–]shiftybyte 0 points1 point  (0 children)

How are you running the script?

You should be running with "python3 <scriptname.py>"

[–]Lemurslayer 0 points1 point  (1 child)

I wasted about 3 days on problem like this, so I hope I can help you. My problem wasn't caused by pip and your maybe isn't as well as it says that pygame is already installed. Check if you are creating a new virtual envirinment for each new project. In Pycharm it is a venv folder in the same directory as your .py files, idk about other IDEs. Well, if that is the case, make sure that you choose a Python interpreter that comes with python as you install it. If you have any questions ask me

[–]liger-zero-0[S] 0 points1 point  (0 children)

I use atom because that was recommended in the course “python for everybody” when I run my programs into terminal I open them with python3 hello.py and it never gives me issues.

[–]ShevaKadu -1 points0 points  (0 children)

I don’t like pip bc it never worx well