Python Forum
Can't get pygame to install
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can't get pygame to install
#1
I'm using Visual Studio Code to write in Python. I'm trying to install pygame but I'm getting this error:

Error:
PS C:\Users\djwil\Documents\python\learning python> py -m pip install -U pygame --user WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pygame/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pygame/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pygame/ WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pygame/ WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pygame/ Could not fetch URL https://pypi.org/simple/pygame/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pygame/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping ERROR: Could not find a version that satisfies the requirement pygame (from versions: none) ERROR: No matching distribution found for pygame WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
I'm not exactly a computer expert could anybody explain to me what this error means and how I should go about fixing it? I'm on windows 10 in case that's relevant.
Reply
#2
use: pip install pygame
drop the py -m
Reply
#3
Thanks for your reply when I removed those I get this error

Error:
PS C:\Users\djwil\Documents\python\learning python> pip install -U pygame --user pip : The term 'pip' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + pip install -U pygame --user + ~~~ + CategoryInfo : ObjectNotFound: (pip:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
I also tried just using pip install pygame and got the same error

Error:
PS C:\Users\djwil\Documents\python\learning python> pip install pygame pip : The term 'pip' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + pip install pygame + ~~~ + CategoryInfo : ObjectNotFound: (pip:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
Can you offer any further advice?
Reply
#4
do you have python installed?
which operating system?
Reply
#5
Yeah I have python installed and have used it before with no issue. My operating system is windows 10.
Reply
#6
You need to be in the right directory to be able to use pip.
Copy your python directory to command prompt, cd Scripts, and pip install from there.
Reply
#7
If what MK_CodingSpace says is true, then your environment variables are not properly set.
see: https://docs.python.org/3/using/cmdline....-variables

or reinstall, and click the check box when asked if you want environment variables to be automatically set for you (shown during installation process).
Reply
#8
Thanks for your help guys,I think I've managed to install pygame, as I getthis output from the terminal.
Output:
PS C:\Users\djwil\Documents\python\learning python> pip install pygame Requirement already satisfied: pygame in c:\users\djwil\appdata\local\programs\python\python38\lib\site-packages (2.0.0) WARNING: You are using pip version 20.2.1; however, version 20.3.1 is available. You should consider upgrading via the 'c:\users\djwil\appdata\local\programs\python\python38\python.exe -m pip install --upgrade pip' command. PS C:\Users\djwil\Documents\python\learning python>
However when I run this code again I still get this error:

Error:
File "c:\Users\djwil\Documents\python\python crash course\Projects\Alien invasion\alien_invasion.py", line 3, in <module> import pygame #contains functionality to make a game ModuleNotFoundError: No module named 'pygame' PS C:\Users\djwil\Documents\python\learning python>
I'm not sure why its telling me it can't find the module when its previously showed that its been downloaded.
Reply
#9
try:
# Get version of python that is default
python -V 
# Get the version of pip that is default
pip -V

# list installed packages
pip list
please see if everything matches up, and that you see pygame.
I'm suspecting some sort of mismatch, each version of python has it's own pip.

you may have to use:
pip3 install pygame
Reply
#10
make sure that Visual Studio is using the python interpreter you installed pygame to and not a different python version that that IDE had installed separately.
Recommended Tutorials:
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Trying to install pygame Mac OS x high sierra giladal 2 2,754 Oct-18-2020, 09:27 PM
Last Post: nilamo
  Error to install pygame skp 1 3,499 Apr-14-2020, 05:17 PM
Last Post: joe_momma
  PIP cannot install Pygame Amaly84 6 9,895 Sep-04-2019, 07:59 PM
Last Post: Amaly84
  pip install pygame choking on SDL dependency sneakyimp 20 12,849 Jan-23-2019, 12:36 PM
Last Post: metulburr
  pip can't install pygame SheeppOSU 1 9,467 Dec-08-2018, 08:20 PM
Last Post: snippsat
  How to install Pygame chappie 2 3,432 Dec-06-2017, 10:47 PM
Last Post: chappie
  How to begin coding for game making [Install pygame on mac] mattkrebs 2 4,960 Apr-02-2017, 10:57 AM
Last Post: machrider
  [split] permission error on pygame install pyteach 7 8,210 Jan-23-2017, 11:00 PM
Last Post: pyteach

Forum Jump:

User Panel Messages

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