Every time i try and download pygame, this is what i get:
C:Users——>python3 -m pip install pygame==2.0.2.dev2
Collecting pygame==2.0.2.dev2
Downloading pygame-2.0.2.dev2.tar.gz (5.7 MB)
|████████████████████████████████| 5.7 MB 1.3 MB/s
ERROR: Command errored out with exit status 1:
command: ‘C:Users——AppDataLocalMicrosoftWindowsAppsPythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0python.exe’ -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘»‘»‘C:Users——AppDataLocalTemppip-install-85ltizv2pygame_5aecdc50663342dfbd64a44c04743912setup.py'»‘»‘; file='»‘»‘C:Users——AppDataLocalTemppip-install-85ltizv2pygame_5aecdc50663342dfbd64a44c04743912setup.py'»‘»‘;f = getattr(tokenize, ‘»‘»‘open'»‘»‘, open)(file) if os.path.exists(file) else io.StringIO(‘»‘»‘from setuptools import setup; setup()'»‘»‘);code = f.read().replace(‘»‘»‘rn'»‘»‘, ‘»‘»‘n'»‘»‘);f.close();exec(compile(code, file, ‘»‘»‘exec'»‘»‘))’ egg_info —egg-base ‘C:Users——AppDataLocalTemppip-pip-egg-info-10n8kp0k’
cwd: C:Users——AppDataLocalTemppip-install-85ltizv2pygame_5aecdc50663342dfbd64a44c04743912
Complete output (79 lines):
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:Users-----AppDataLocalTemppip-install-85ltizv2pygame_5aecdc50663342dfbd64a44c04743912setup.py", line 322, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:Users-----AppDataLocalTemppip-install-85ltizv2pygame_5aecdc50663342dfbd64a44c04743912buildconfigconfig.py", line 221, in main
deps = CFG.main(**kwds)
File "C:Users-----AppDataLocalTemppip-install-85ltizv2pygame_5aecdc50663342dfbd64a44c04743912buildconfigconfig_win.py", line 574, in main
return setup_prebuilt_sdl2(prebuilt_dir)
File "C:UsersSilasAppDataLocalTemppip-install-85ltizv2pygame_5aecdc50663342dfbd64a44c04743912buildconfigconfig_win.py", line 499, in setup_prebuilt_sdl2
DEPS.configure()
File "C:UsersSilasAppDataLocalTemppip-install-85ltizv2pygame_5aecdc50663342dfbd64a44c04743912buildconfigconfig_win.py", line 336, in configure
from . import vstools
File "C:UsersSilasAppDataLocalTemppip-install-85ltizv2pygame_5aecdc50663342dfbd64a44c04743912buildconfigvstools.py", line 11, in <module>
compiler.initialize()
File "C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.10_3.10.194.0_x64__qbz5n2kfra8p0libdistutilsmsvc9compiler.py", line 371, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.10_3.10.194.0_x64__qbz5n2kfra8p0libsite-packagessetuptoolsmsvc.py", line 140, in msvc9_query_vcvarsall
return EnvironmentInfo(arch, ver).return_env()
File "C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.10_3.10.194.0_x64__qbz5n2kfra8p0libsite-packagessetuptoolsmsvc.py", line 1740, in return_env
[self.VCIncludes,
File "C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.10_3.10.194.0_x64__qbz5n2kfra8p0libsite-packagessetuptoolsmsvc.py", line 1282, in VCIncludes
return [join(self.si.VCInstallDir, 'Include'),
File "C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.10_3.10.194.0_x64__qbz5n2kfra8p0libsite-packagessetuptoolsmsvc.py", line 840, in VCInstallDir
raise distutils.errors.DistutilsPlatformError(msg)
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.2 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
Making dir :prebuilt_downloads:
Downloading... https://www.libsdl.org/release/SDL2-devel-2.0.16-VC.zip 13d952c333f3c2ebe9b7bc0075b4ad2f784e7584
Unzipping :prebuilt_downloadsSDL2-devel-2.0.16-VC.zip:
Downloading... https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.5-VC.zip 137f86474691f4e12e76e07d58d5920c8d844d5b
Unzipping :prebuilt_downloadsSDL2_image-devel-2.0.5-VC.zip:
Downloading... https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-devel-2.0.15-VC.zip 1436df41ebc47ac36e02ec9bda5699e80ff9bd27
Unzipping :prebuilt_downloadsSDL2_ttf-devel-2.0.15-VC.zip:
Downloading... https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-devel-2.0.4-VC.zip 9097148f4529cf19f805ccd007618dec280f0ecc
Unzipping :prebuilt_downloadsSDL2_mixer-devel-2.0.4-VC.zip:
Downloading... https://www.ijg.org/files/jpegsr9d.zip ed10aa2b5a0fcfe74f8a6f7611aeb346b06a1f99
Unzipping :prebuilt_downloadsjpegsr9d.zip:
Downloading... https://pygame.org/ftp/prebuilt-x64-pygame-1.9.2-20150922.zip 3a5af3427b3aa13a0aaf5c4cb08daaed341613ed
Unzipping :prebuilt_downloadsprebuilt-x64-pygame-1.9.2-20150922.zip:
copying into .prebuilt-x64
Path for SDL: prebuilt-x64SDL2-2.0.16
...Library directory for SDL: prebuilt-x64/SDL2-2.0.16/lib/x64
...Include directory for SDL: prebuilt-x64/SDL2-2.0.16/include
Path for FONT: prebuilt-x64SDL2_ttf-2.0.15
...Library directory for FONT: prebuilt-x64/SDL2_ttf-2.0.15/lib/x64
...Include directory for FONT: prebuilt-x64/SDL2_ttf-2.0.15/include
Path for IMAGE: prebuilt-x64SDL2_image-2.0.5
...Library directory for IMAGE: prebuilt-x64/SDL2_image-2.0.5/lib/x64
...Include directory for IMAGE: prebuilt-x64/SDL2_image-2.0.5/include
Path for MIXER: prebuilt-x64SDL2_mixer-2.0.4
...Library directory for MIXER: prebuilt-x64/SDL2_mixer-2.0.4/lib/x64
...Include directory for MIXER: prebuilt-x64/SDL2_mixer-2.0.4/include
Path for PORTMIDI: prebuilt-x64
...Library directory for PORTMIDI: prebuilt-x64/lib
...Include directory for PORTMIDI: prebuilt-x64/include
DLL for SDL2: prebuilt-x64/SDL2-2.0.16/lib/x64/SDL2.dll
DLL for SDL2_ttf: prebuilt-x64/SDL2_ttf-2.0.15/lib/x64/SDL2_ttf.dll
DLL for SDL2_image: prebuilt-x64/SDL2_image-2.0.5/lib/x64/SDL2_image.dll
DLL for SDL2_mixer: prebuilt-x64/SDL2_mixer-2.0.4/lib/x64/SDL2_mixer.dll
DLL for portmidi: prebuilt-x64/lib/portmidi.dll
Path for FREETYPE not found.
...Found include dir but no library dir in prebuilt-x64.
Path for PNG not found.
...Found include dir but no library dir in prebuilt-x64.
Path for JPEG not found.
...Found include dir but no library dir in prebuilt-x64.
DLL for freetype: prebuilt-x64/SDL2_ttf-2.0.15/lib/x64/libfreetype-6.dll
---
For help with compilation see:
https://www.pygame.org/wiki/CompileWindows
To contribute to pygame development see:
https://www.pygame.org/contribute.html
---
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/a9/7c/d6d95935e801cf83566ee34b2f597a8214e340466b0364b4db5a2f05bc16/pygame-2.0.2.dev2.tar.gz#sha256=8d5ffc089075b68ca948a88c0678a9d6bf5fed69676fee221fb562f4a788611b (from https://pypi.org/simple/pygame/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement pygame==2.0.2.dev2 (from versions: 1.9.2rc1, 1.9.2, 1.9.3, 1.9.4.dev0, 1.9.4rc1, 1.9.4, 1.9.5rc1, 1.9.5rc2, 1.9.5, 1.9.6rc1, 1.9.6rc2, 1.9.6, 2.0.0.dev1, 2.0.0.dev2, 2.0.0.dev3, 2.0.0.dev4, 2.0.0.dev6, 2.0.0.dev8, 2.0.0.dev10, 2.0.0.dev12, 2.0.0.dev14, 2.0.0.dev16, 2.0.0.dev18, 2.0.0.dev20, 2.0.0.dev22, 2.0.0.dev24, 2.0.0, 2.0.1.dev1, 2.0.1, 2.0.2.dev2)
ERROR: No matching distribution found for pygame==2.0.2.dev2
i’ve tried different versions, commands, etc and nothing works.
i need help
Thread Rating:
- 0 Vote(s) — 0 Average
- 1
- 2
- 3
- 4
- 5
Can’t get pygame to install |
I’m using Visual Studio Code to write in Python. I’m trying to install pygame but I’m getting this error:
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. Posts: 11,566 Threads: 446 Joined: Sep 2016 Reputation: Dec-03-2020, 04:00 PM
use: pip install pygame Posts: 63 Threads: 28 Joined: Jul 2020 Reputation: Thanks for your reply when I removed those I get this error
I also tried just using pip install pygame and got the same error
Can you offer any further advice? Posts: 11,566 Threads: 446 Joined: Sep 2016 Reputation:
do you have python installed? Posts: 63 Threads: 28 Joined: Jul 2020 Reputation: Yeah I have python installed and have used it before with no issue. My operating system is windows 10. Posts: 44 Threads: 4 Joined: Nov 2020 Reputation:
You need to be in the right directory to be able to use pip. Posts: 11,566 Threads: 446 Joined: Sep 2016 Reputation: Dec-03-2020, 08:22 PM
If what MK_CodingSpace says is true, then your environment variables are not properly set. or reinstall, and click the check box when asked if you want environment variables to be automatically set for you (shown during installation process). Posts: 63 Threads: 28 Joined: Jul 2020 Reputation: Thanks for your help guys,I think I’ve managed to install pygame, as I getthis output from the terminal.
However when I run this code again I still get this error:
I’m not sure why its telling me it can’t find the module when its previously showed that its been downloaded. Posts: 11,566 Threads: 446 Joined: Sep 2016 Reputation: 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. you may have to use: Posts: 5,147 Threads: 395 Joined: Sep 2016 Reputation: Dec-06-2020, 12:53 AM 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. |
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Trying to install pygame Mac OS x high sierra | giladal | 2 | 2,083 |
Oct-18-2020, 09:27 PM Last Post: nilamo |
|
Error to install pygame | skp | 1 | 2,835 |
Apr-14-2020, 05:17 PM Last Post: joe_momma |
|
PIP cannot install Pygame | Amaly84 | 6 | 7,691 |
Sep-04-2019, 07:59 PM Last Post: Amaly84 |
|
pip install pygame choking on SDL dependency | sneakyimp | 20 | 10,228 |
Jan-23-2019, 12:36 PM Last Post: metulburr |
|
pip can’t install pygame | SheeppOSU | 1 | 8,668 |
Dec-08-2018, 08:20 PM Last Post: snippsat |
|
How to install Pygame | chappie | 2 | 2,818 |
Dec-06-2017, 10:47 PM Last Post: chappie |
|
How to begin coding for game making [Install pygame on mac] | mattkrebs | 2 | 4,319 |
Apr-02-2017, 10:57 AM Last Post: machrider |
|
[split] permission error on pygame install | pyteach | 7 | 6,918 |
Jan-23-2017, 11:00 PM Last Post: pyteach |
Sometimes you get an error when you’re trying to install a Python package
using pip. It looks like this:
Could not find a version that satisfies the requirement (from versions:)
No matching distribution found for
Some probable reasons for this error are:
-
PyPI server isn’t responding to your requests. It can happen either because
the PyPI server is down or because it has blacklisted your IP address. This
happened to me once when I was trying installing packages on a server.
This can be fixed by using a proxy with pip. See the solution below. -
You’re running an older pip (especially on Mac). This can be fixed by
upgrading your pip.
See this post on Stack Overflow.
Thanks to Anupam Jain who pointed this in a comment. -
The package you’re trying to install is not available for your Python version.
-
The package is not available for your operating system. This is a rare case
and only happens when the package is not pure-Python, i.e. it’s been
partially written in C or Cython. Such a package needs to be compiled for
every operating system (Windows/Mac/Linux) and architecture (32-bit/64-bit).
Suppose a package has only been compiled for Windows 64-bit, then you’ll get
this error if you try to install it on Windows 32-bit, or any other
OS. -
The package is not present on PyPI server. In this case pip will not work. So
you’ll have to download and install the package manually from Github or wherever
it is available.
Solution¶
I had this issue because PyPI server had blacklisted the IP
of my hosting provider, the obvious solution was to make pip
install via a proxy.
But to see if that’s also the case with you, you can test it like this:
$ curl https://pypi.org
The requestors Network has been blacklisted due to excessive request volume.
If you are a hosting customer, please contact your hosting company's support.
If you are the hosting company, please contact infrastructure-staff@python.org to resolve
If you see the message similar to above, that means your IP has also been
blacklisted by https://pypi.org.
If you don’t see this message then the reason for the pip error could be that you’re using
an older version. See this post on Stack Overflow
for a solution.
Anyways, this can be fixed by using a proxy with pip.
Supplying a proxy address to pip
is easy:
$ pip install -r requirements.txt --proxy address:port
Above, address
and port
are IP address and port of the proxy.
To find proxies, just search Google for proxy list.
Other things that I tried¶
These are some other things that I tried to get rid of this issue.
Although they didn’t work for me, but they might work for you.
- Changing DNS resolver of my server.
This makes sense if your server’s DNS resolver can’t find PyPI servers. - Reconfiguring SSL, reinstalling CA certificates.
This makes sense if you don’t have updated CA certificates which are used by
PyPI servers. - Downloading packages using
wget
.
This is an alternative way to install Python packages. Download them viawget
and then install them usingpython setup.py install
. In my case, the server was
blacklisted by PyPI so I was getting a 403 Forbidden error. - Downloading packages using
curl
.
Alternative towget
. In my case I didn’t get a 403 error but rather it just
created invalid tarball files, instead of actually downloading them. - Downloading packages using
git
orhg
.
If your desired packages havegit
orhg
repositories that you can clone, this
is a good workaround.
Этим утром я попытался установить pygame в командной строке Windows и получил ошибку, подобную этой:
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
C:UsersUser>pip install pygame
Collecting pygame
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None))
after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFI
CATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certif
icate (_ssl.c:1045)'))': /simple/pygame/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None))
after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFI
CATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certif
icate (_ssl.c:1045)'))': /simple/pygame/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None))
after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFI
CATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certif
icate (_ssl.c:1045)'))': /simple/pygame/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None))
after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFI
CATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certif
icate (_ssl.c:1045)'))': /simple/pygame/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None))
after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFI
CATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certif
icate (_ssl.c:1045)'))': /simple/pygame/
Could not fetch URL https://pypi.org/simple/pygame/: There was a problem confi
rming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max r
etries exceeded with url: /simple/pygame/ (Caused by SSLError(SSLCertVerificatio
nError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to
get local issuer certificate (_ssl.c:1045)'))) - skipping
Could not find a version that satisfies the requirement pygame (from versions:
)
No matching distribution found for pygame
C:UsersUser>
Поэтому я попытался запустить Anaconda для установки Pygame, но я получил еще одну ошибку.
(base) C:UsersUser>conda install -c cogsci pygame
Solving environment: failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pk
gs/pro/win-64/repodata.json.bz2>
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.
SSLError(MaxRetryError('HTTPSConnectionPool(host='repo.anaconda.com', port=443
): Max retries exceeded with url: /pkgs/pro/win-64/repodata.json.bz2 (Caused by
SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_server_ce
rtificate', 'certificate verify failed')])")))'))
(base) C:UsersUser>
Я не могу понять ошибку. Команда работала раньше, но сейчас она не работает. Я думал, что это ошибка соединения, но я могу без проблем запустить любой веб-сайт. Что мне делать?