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.
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?
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).
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.
# list installed packages
pip listplease 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