Python Forum
please help this newb install pygame
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
please help this newb install pygame
#1
I just installed python 3.7.3

What is the command to install pygame? I have tried:

pip install pygame
pip3 install pygame
python3 -m pip install -U pygame
python -m pip install pygame

Each of the above commands were provided by different websites, one of them being the pygame website.

Each syntax error highlights "pip" like python doesn't recognize what it is.

I have a copy of pygame 1.9.3 that works with python 3.5.3 but I wanted to use the latest version of python, if possible.

Any help would be appreciated.
Reply
#2
Are you on windows or linux?
Recommended Tutorials:
Reply
#3
Windows 10
Reply
#4
Im not up to par with the windows methods as i haven't used windows in decades.

When you install the latest python make sure you have the check boxes marked for adding python to path, pip, py launcher, etc. shown here. Check that link instructions to make sure your pip and python is in the path. Then try to reinstall pygame with pip

(May-15-2019, 11:59 AM)iofhua Wrote: Each syntax error highlights "pip" like python doesn't recognize what it is.
This i believe means your pip is not in your path. That or you are trying to run it from the python interpreter and not the windows command prompt? This means you did not follow the installation instructions properly.

you can try using the py launcher if you installed it along with python
py -3.7 -m pip install pygame
here are some more detailed pygame installation instructions
https://python-forum.io/Thread-PyGame-In...leshooting

and pygame's installation instructions
https://www.pygame.org/wiki/GettingStarted
Recommended Tutorials:
Reply
#5
I followed this tutorial here:
https://youtu.be/Lp-0d04hfrs

which had a link to the pygame libraries here:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame

The latest pygame library for Windows (pygame‑1.9.4‑cp37‑cp37m‑win_amd64.whl) is compatible with python 3.7.2

I just had to copy the file to the scripts folder and make a batch file to install it.

IMO the community is a little discombobulated. The pygame website says enter this line of text to install it but it doesn't work, and the latest pygame libraries are available on a different website, and the latest version of python isn't compatible. How are newbies supposed to even approach this?

If I didn't doggedly rake through the Internet and try all the things I wouldn't have gotten this far.
Reply
#6
If pygame does not install with pip command then you should have stopped there and fix it, not work around it. You should never have to make a batch file to install or copy it to the scripts folder.

The wheel file from ifd.uci issue is they are not always compatible. They are NOT official. So you can have anything technically happen. However they are nice to have at times. A wheel file labeled 3.7 does not indicate if it is for python 3.7.3, 3.7.2, 3.7.1 or 3.7.0 (and i have had issues with that before). It may work, or it may not. The only way to verify that is to try to install it with each python minor version to see which one it is for. You would not even know if they update that wheel because they only label it for 3.7, within the time of the youtube video and you downloading it, they could even change it to a different 3.7.X version.

The official way to download pygame is to use pip. If there is a problem with your pip then you are expected to fix it. If pygame is not updated to the latest version of python, then the "offical" way is to downgrade your python version to use the latest pygame version.

Having said that....I have had issues in the past with pygame not compatible with the latest python. This is actually common with all python 3rd party libs. As python comes out with so many releases ALL 3rd party libraries have to keep up with every one and there is a sure delay in that. You can try to get the latest possible by using ifc.uci's wheels, but you have to mess around with it. If you are not using python 3.7.3 new features, then there is no reason why you are fighting with it. Im pretty sure python3.6.X all work and that is the last major change in python. The simplest approach would be to use python3.6.x, but you can try with python3.7.0 with the wheel if there is no official release of pygame for it. (NOTE: I havent been to par on pygame either so i am not sure what their latest releases are).
Recommended Tutorials:
Reply
#7
(May-15-2019, 11:59 AM)iofhua Wrote: Each syntax error highlights "pip" like python doesn't recognize what it is.
A wild guess but getting SyntaxError suggest you are trying to run pip from within python (python interactive mode maybe?)... Otherwise you will get something within the lines "pip is not recognized as internal or external command, operable program or batch file"
You need to run pip from the command prompt. Can you provide a full error message you get or a screenshot?
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#8
Oh, I didn't see @metulburr already mentioned that...
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python newb need help Fictile 1 188 Apr-02-2024, 03:28 AM
Last Post: buran
  NameError issue with daughter's newb code MrGonk 2 1,448 Sep-16-2021, 01:29 PM
Last Post: BashBedlam
  pygame install windows 10 s fenny666 4 4,231 Mar-21-2020, 03:55 AM
Last Post: fenny666
  Help figuring out why I can't install pygame Skeleton_Warrior 4 13,069 Oct-20-2019, 10:02 PM
Last Post: Skeleton_Warrior
  Simple newb string question Involute 2 2,196 Sep-08-2019, 12:50 AM
Last Post: Involute
  Newb question: Debugging + Linting Python in Visual Studio Code Drone4four 1 2,420 Apr-15-2019, 06:19 AM
Last Post: perfringo
  Newb question about %02d %04d bennylava 30 19,407 Mar-05-2019, 11:23 PM
Last Post: snippsat
  Pthyon 3 question (newb) bennylava 11 5,838 Feb-28-2019, 06:04 PM
Last Post: buran
  newb selfie PatM 5 3,601 Feb-19-2019, 12:20 AM
Last Post: snippsat
  Complete NEWB and openpyxl project Netopia 44 17,244 Jan-18-2019, 08:15 PM
Last Post: Netopia

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020