Problem with installing pygame, python 3.11.1 [duplicate] - python

This question already has answers here:
Python pygame not installing
(3 answers)
Unable to install Pygame using pip
(27 answers)
Closed 2 months ago.
When I try to run the following command in the folder of my project, in cmd:
py -m pip install pygame
It fails with the following details:
Collecting pygame
Using cached pygame-2.1.2.tar.gz (10.1 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [77 lines of output]
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\netan\AppData\Local\Temp\pip-install-yjshn064\pygame_8c807f777c7245d49c8e8229be7d7b98\setup.py", line 359, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\netan\AppData\Local\Temp\pip-install-yjshn064\pygame_8c807f777c7245d49c8e8229be7d7b98\buildconfig\config.py", line 225, in main
deps = CFG.main(**kwds)
^^^^^^^^^^^^^^^^
File "C:\Users\netan\AppData\Local\Temp\pip-install-yjshn064\pygame_8c807f777c7245d49c8e8229be7d7b98\buildconfig\config_win.py", line 511, in main
return setup_prebuilt_sdl2(prebuilt_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\netan\AppData\Local\Temp\pip-install-yjshn064\pygame_8c807f777c7245d49c8e8229be7d7b98\buildconfig\config_win.py", line 471, in setup_prebuilt_sdl2
DEPS.configure()
File "C:\Users\netan\AppData\Local\Temp\pip-install-yjshn064\pygame_8c807f777c7245d49c8e8229be7d7b98\buildconfig\config_win.py", line 336, in configure
from . import vstools
File "C:\Users\netan\AppData\Local\Temp\pip-install-yjshn064\pygame_8c807f777c7245d49c8e8229be7d7b98\buildconfig\vstools.py", line 11, in <module>
compiler.initialize()
File "C:\Users\netan\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\_distutils\msvc9compiler.py", line 403, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\netan\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\_distutils\msvc9compiler.py", line 281, in query_vcvarsall
raise DistutilsPlatformError("Unable to find vcvarsall.bat")
distutils.errors.DistutilsPlatformError: Unable to find vcvarsall.bat
Making dir :prebuilt_downloads:
Downloading... https://www.libsdl.org/release/SDL2-devel-2.0.18-VC.zip ed561079ec622b0bab5a9e02976f5d540b0622da
Unzipping :prebuilt_downloads\SDL2-devel-2.0.18-VC.zip:
Downloading... https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.5-VC.zip 137f86474691f4e12e76e07d58d5920c8d844d5b
Unzipping :prebuilt_downloads\SDL2_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_downloads\SDL2_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_downloads\SDL2_mixer-devel-2.0.4-VC.zip:
Downloading... https://www.pygame.org/ftp/jpegsr9d.zip ed10aa2b5a0fcfe74f8a6f7611aeb346b06a1f99
Unzipping :prebuilt_downloads\jpegsr9d.zip:
Downloading... https://pygame.org/ftp/prebuilt-x64-pygame-1.9.2-20150922.zip 3a5af3427b3aa13a0aaf5c4cb08daaed341613ed
Unzipping :prebuilt_downloads\prebuilt-x64-pygame-1.9.2-20150922.zip:
copying into .\prebuilt-x64
Path for SDL: prebuilt-x64\SDL2-2.0.18
...Library directory for SDL: prebuilt-x64/SDL2-2.0.18/lib/x64
...Include directory for SDL: prebuilt-x64/SDL2-2.0.18/include
Path for FONT: prebuilt-x64\SDL2_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-x64\SDL2_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-x64\SDL2_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.18/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
---
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
No idea how to solve it. I saw articles saying to revert to older versions of python. But I want to use python 3.11.1, is pygame not yet available on python 3.11.1?
I worked fine for me on 3.10 like a month ago.
I should note - any other package (for example, flask, requests etc...) installs successfully.

Related

When i try to install pygame using pip it gives me an error and says the problem isnt with pip [duplicate]

This question already has answers here:
Python pygame not installing
(3 answers)
Unable to install Pygame using pip
(27 answers)
Closed 2 months ago.
Error:
Collecting pygame
Using cached pygame-2.1.2.tar.gz (10.1 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [77 lines of output]
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\fun64\AppData\Local\Temp\pip-install-70lspblc\pygame_6645675c044f46cda093da402f331cb2\setup.py", line 359, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\fun64\AppData\Local\Temp\pip-install-70lspblc\pygame_6645675c044f46cda093da402f331cb2\buildconfig\config.py", line 225, in main
deps = CFG.main(**kwds)
^^^^^^^^^^^^^^^^
File "C:\Users\fun64\AppData\Local\Temp\pip-install-70lspblc\pygame_6645675c044f46cda093da402f331cb2\buildconfig\config_win.py", line 511, in main
return setup_prebuilt_sdl2(prebuilt_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\fun64\AppData\Local\Temp\pip-install-70lspblc\pygame_6645675c044f46cda093da402f331cb2\buildconfig\config_win.py", line 471, in setup_prebuilt_sdl2
DEPS.configure()
File "C:\Users\fun64\AppData\Local\Temp\pip-install-70lspblc\pygame_6645675c044f46cda093da402f331cb2\buildconfig\config_win.py", line 336, in configure
from . import vstools
File "C:\Users\fun64\AppData\Local\Temp\pip-install-70lspblc\pygame_6645675c044f46cda093da402f331cb2\buildconfig\vstools.py", line 11, in <module>
compiler.initialize()
File "C:\Users\fun64\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\_distutils\msvc9compiler.py", line 403, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\fun64\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\_distutils\msvc9compiler.py", line 281, in query_vcvarsall
raise DistutilsPlatformError("Unable to find vcvarsall.bat")
distutils.errors.DistutilsPlatformError: Unable to find vcvarsall.bat
Making dir :prebuilt_downloads:
Downloading... https://www.libsdl.org/release/SDL2-devel-2.0.18-VC.zip ed561079ec622b0bab5a9e02976f5d540b0622da
Unzipping :prebuilt_downloads\SDL2-devel-2.0.18-VC.zip:
Downloading... https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.5-VC.zip 137f86474691f4e12e76e07d58d5920c8d844d5b
Unzipping :prebuilt_downloads\SDL2_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_downloads\SDL2_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_downloads\SDL2_mixer-devel-2.0.4-VC.zip:
Downloading... https://www.pygame.org/ftp/jpegsr9d.zip ed10aa2b5a0fcfe74f8a6f7611aeb346b06a1f99
Unzipping :prebuilt_downloads\jpegsr9d.zip:
Downloading... https://pygame.org/ftp/prebuilt-x64-pygame-1.9.2-20150922.zip 3a5af3427b3aa13a0aaf5c4cb08daaed341613ed
Unzipping :prebuilt_downloads\prebuilt-x64-pygame-1.9.2-20150922.zip:
copying into .\prebuilt-x64
Path for SDL: prebuilt-x64\SDL2-2.0.18
...Library directory for SDL: prebuilt-x64/SDL2-2.0.18/lib/x64
...Include directory for SDL: prebuilt-x64/SDL2-2.0.18/include
Path for FONT: prebuilt-x64\SDL2_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-x64\SDL2_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-x64\SDL2_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.18/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
---
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details
Idk what to do if it was a problem with pip i would reinstall but idk wha t to do here
i cant just reinstall pip since that would do nothing is pygame down? or what .........................................................................................................................................................................................
thanks in advance Oh and i also tried downloading microsoft visual c++ build tools but it didnt work it still gives the error

How to fix "DLL load failed while importing QtWidgets"?

The issue:
So, after compilation, inside the dist folder, there is "PyQt5.Qt.pyd" file,
but I am getting this error:
Traceback (most recent call last):
File "main.py", line 102, in <module>
File "<frozen zipimport>", line 259, in load_module
File "<loader>", line 10, in <module>
File "<loader>", line 8, in __load
ImportError: (DLL load failed while importing QtWidgets: The specified module could not be found.) 'Z:\\Project\\dist\\PyQt5.QtWidgets.pyd'
I am pretty sure that that this "Qt" folder from "C:\Program Files (x86)\Python38-32\Lib\site-packages\PyQt5\Qt", which after compilation is converted to "PyQt5.Qt.pyd" file I guess, is responsible for this error. Because when I add this location to my Windows PATH: "C:\Program Files (x86)\Python38-32\Lib\site-packages\PyQt5\Qt\bin", the compiled program works flawlessly.
My temporary fix is:
I copied the "Qt" folder to the "dist", and made a batch script that adds ".\dist\Qt\bin" to PATH, for the current CMD window...Just so I can send it to my client to test it out for now...But this is far from the final solution... What to do?
(I have also tried to copy just "bin", or "platform\qwindows.dll" from "Qt" to dist, but no luck...)
I would appreciate any help or advice regarding this. Thanks in advance!
My info:
OS info:
Windows 10 x64, Python 3.8.6 x32
pip freeze:
altgraph==0.17
cachetools==4.1.1
fbs==0.9.0
future==0.18.2
macholib==1.14
pefile==2019.4.18
Pillow==8.0.1
py2exe==0.10.0.2
PyInstaller==3.4
PyQt5==5.15.1
PyQt5-sip==12.8.1
pywin32==228
pywin32-ctypes==0.2.0
six==1.15.0
py2exe setup.py:
from distutils.core import setup
import py2exe
setup(windows=[{"script":"main.py"}], options={"py2exe":{"includes":["PyQt5.Qt","PyQt5.sip","PyQt5.QtWidgets","PyQt5.QtCore", "PyQt5.QtGui"]}})
Copy all dll's from PyQt5\Qt\bin to dist, except the ones beginning with Qt5* (You might not need d3dcompiler_47, libEGL, libGLESv2 and opengl32sw if your not using direct3d or opengl)
I suggest you try out to run your application converted with py2exe on a newly installed windows (maybe in a virtual machine) to find out if it has other dependencies.
Update: Actually, I only needed to install Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019, without copying any dll files. https://support.microsoft.com/en-us/topic/the-latest-supported-visual-c-downloads-2647da03-1eea-4433-9aff-95f26a218cc0

Installing pygame problem "Microsoft Visual C++ 14.1 is required"

I tried to install pygame but i get this error:
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.1 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
Collecting pygame==2.0.0.dev6
Using cached https://files.pythonhosted.org/packages/c5/a0/63f9ca836e6a08e560f1ef3f2535ffb46bfdad2abb093dd097dae252be28/pygame-2.0.0.dev6.tar.gz
Complete output from command python setup.py egg_info:
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Making dir :prebuilt_downloads:
Downloading... https://www.libsdl.org/release/SDL2-devel-2.0.10-VC.zip 0bbac0106358dc99b8ba2401ae6a1c10d3927ca9
Unzipping :prebuilt_downloads\SDL2-devel-2.0.10-VC.zip:
Downloading... https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.5-VC.zip 137f86474691f4e12e76e07d58d5920c8d844d5b
Unzipping :prebuilt_downloads\SDL2_image-devel-2.0.5-VC.zip:
Downloading... https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-devel-2.0.14-VC.zip c64d90c1f7d1bb3f3dcfcc255074611f017cdcc4
Unzipping :prebuilt_downloads\SDL2_ttf-devel-2.0.14-VC.zip:
Downloading... https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-devel-2.0.4-VC.zip 9097148f4529cf19f805ccd007618dec280f0ecc
Unzipping :prebuilt_downloads\SDL2_mixer-devel-2.0.4-VC.zip:
Downloading... https://www.ijg.org/files/jpegsr9c.zip 9ca086c960ffc4bff821ba194c8d0a15f69eae09
Unzipping :prebuilt_downloads\jpegsr9c.zip:
Downloading... https://bitbucket.org/llindstrom/pygame/downloads/prebuilt-x86-pygame-1.9.2-20150922.zip dbce1d5ea27b3da17273e047826d172e1c34b478
Unzipping :prebuilt_downloads\prebuilt-x86-pygame-1.9.2-20150922.zip:
copying into .\prebuilt-x86
Path for SDL: prebuilt-x86\SDL2-2.0.10
...Library directory for SDL: prebuilt-x86/SDL2-2.0.10/lib/x86
...Include directory for SDL: prebuilt-x86/SDL2-2.0.10/include
Path for FONT: prebuilt-x86\SDL2_ttf-2.0.14
...Library directory for FONT: prebuilt-x86/SDL2_ttf-2.0.14/lib/x86
...Include directory for FONT: prebuilt-x86/SDL2_ttf-2.0.14/include
Path for IMAGE: prebuilt-x86\SDL2_image-2.0.5
...Library directory for IMAGE: prebuilt-x86/SDL2_image-2.0.5/lib/x86
...Include directory for IMAGE: prebuilt-x86/SDL2_image-2.0.5/include
Path for MIXER: prebuilt-x86\SDL2_mixer-2.0.4
...Library directory for MIXER: prebuilt-x86/SDL2_mixer-2.0.4/lib/x86
...Include directory for MIXER: prebuilt-x86/SDL2_mixer-2.0.4/include
Path for PORTMIDI: prebuilt-x86
...Library directory for PORTMIDI: prebuilt-x86/lib
...Include directory for PORTMIDI: prebuilt-x86/include
DLL for SDL2: prebuilt-x86/SDL2-2.0.10/lib/x86/SDL2.dll
DLL for SDL2_ttf: prebuilt-x86/SDL2_ttf-2.0.14/lib/x86/SDL2_ttf.dll
DLL for SDL2_image: prebuilt-x86/SDL2_image-2.0.5/lib/x86/SDL2_image.dll
DLL for SDL2_mixer: prebuilt-x86/SDL2_mixer-2.0.4/lib/x86/SDL2_mixer.dll
DLL for portmidi: prebuilt-x86/lib/portmidi.dll
Path for FREETYPE not found.
...Found include dir but no library dir in prebuilt-x86.
Path for PNG not found.
...Found include dir but no library dir in prebuilt-x86.
Path for JPEG not found.
...Found include dir but no library dir in prebuilt-x86.
DLL for freetype: prebuilt-x86/SDL2_ttf-2.0.14/lib/x86/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
---
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Operator\AppData\Local\Temp\pycharm-packaging\pygame\setup.py", line 258, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\Operator\AppData\Local\Temp\pycharm-packaging\pygame\buildconfig\config.py", line 208, in main
deps = CFG.main(**kwds)
File "C:\Users\Operator\AppData\Local\Temp\pycharm-packaging\pygame\buildconfig\config_win.py", line 574, in main
return setup_prebuilt_sdl2(prebuilt_dir)
File "C:\Users\Operator\AppData\Local\Temp\pycharm-packaging\pygame\buildconfig\config_win.py", line 499, in setup_prebuilt_sdl2
DEPS.configure()
File "C:\Users\Operator\AppData\Local\Temp\pycharm-packaging\pygame\buildconfig\config_win.py", line 336, in configure
from . import vstools
File "C:\Users\Operator\AppData\Local\Temp\pycharm-packaging\pygame\buildconfig\vstools.py", line 11, in <module>
compiler.initialize()
File "C:\Users\Operator\AppData\Local\Programs\Python\Python38-32\lib\distutils\msvc9compiler.py", line 372, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:\Users\Operator\PycharmProjects\Spaceinvader\venv\lib\site-packages\setuptools-40.8.0-py3.8.egg\setuptools\msvc.py", line 147, in msvc9_query_vcvarsall
File "C:\Users\Operator\PycharmProjects\Spaceinvader\venv\lib\site-packages\setuptools-40.8.0-py3.8.egg\setuptools\msvc.py", line 1227, in return_env
File "C:\Users\Operator\PycharmProjects\Spaceinvader\venv\lib\site-packages\setuptools-40.8.0-py3.8.egg\setuptools\msvc.py", line 876, in VCIncludes
File "C:\Users\Operator\PycharmProjects\Spaceinvader\venv\lib\site-packages\setuptools-40.8.0-py3.8.egg\setuptools\msvc.py", line 555, in VCInstallDir
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.1 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Operator\AppData\Local\Temp\pycharm-packaging\pygame\
pip is updated, setuptools updated
I've just installed Visual Studio and Visual Studio Build Tolls 2019 but still get this error.
I dont really know what i can do now
Maybe it must be exactly 14.1 version ?
I had the same error. I noticed this error might be as a result of either wrong python path on the system environment variables or you have defined more than one python environment on your project. Also having multiple versions of Python. To solve this problem, you can reinstall Python. However, this is not a guarantee solution, but checking your project interpreter and the Python environment should be a good place to begin.
On the project interpreter click the plus sign to set up a new environment for your project.
Option 2: check out this link https://docs.python.org/3/library/venv.html to create a new python environment for your project. But make sure you only have one version of python installed. This worked well for me.

Can't download pygame with pip on windows

Keep running into this issue trying to download pygame. How do i download it with pip? I use a 64bit windows 10 w/ python 3.7... Thanks
C:\Users\Antoine>python -m pip install -U pygame --user
Collecting pygame
Using cached https://files.pythonhosted.org/packages/61/06/3c25051549c252cc6fde01c8aeae90b96831370884504fe428a623316def/pygame-1.9.3.tar.gz
Complete output from command python setup.py egg_info:
WARNING, No "Setup" File Exists, Running "config.py"
Using WINDOWS configuration...
Path for SDL not found.
Too bad that is a requirement! Hand-fix the "Setup"
Path for FONT not found.
Path for IMAGE not found.
Path for MIXER not found.
Path for PNG not found.
Path for JPEG not found.
Path for PORTMIDI not found.
Path for COPYLIB_tiff not found.
Path for COPYLIB_z not found.
Path for COPYLIB_vorbis not found.
Path for COPYLIB_ogg not found.
If you get compiler errors during install, doublecheck
the compiler flags in the "Setup" file.
Continuing With "setup.py"
Error with the "Setup" file,
perhaps make a clean copy from "Setup.in".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Antoine\AppData\Local\Temp\pip-install-0c2lpkkq\pygame\setup.py", line 165, in <module>
extensions = read_setup_file('Setup')
File "C:\Python\Python37\lib\distutils\extension.py", line 171, in read_setup_file
line = expand_makefile_vars(line, vars)
File "C:\Python\Python37\lib\distutils\sysconfig.py", line 407, in expand_makefile_vars
s = s[0:beg] + vars.get(m.group(1)) + s[end:]
TypeError: can only concatenate str (not "NoneType") to str
Pygame doesn't install properly in 3.7. Install 3.6.6 instead. I had the same problem

Trouble installing pygame inside virtualenv

I'm trying to install pygame inside a virtualenvs on windows (I use powershell-virtualenwrapper).
But when I run pip install hg+http://www.bitbucket.org/pygame/pygame it fail with this log:
------------------------------------------------------------
C:\Users\Marci\.virtualenvs\pygame\Scripts\pip run on 05/22/15 14:39:29
Downloading/unpacking hg+http://bitbucket.org/pygame/pygame
Cloning hg http://bitbucket.org/pygame/pygame to c:\users\marci\appdata\local\temp\pip-fyauuh-build
Found command 'hg' at 'C:\\Program Files\\TortoiseHg\\hg.exe'
Running command "C:\Program Files\TortoiseHg\hg.exe" clone --noupdate -q http://bitbucket.org/pygame/pygame c:\users\marci\appdata\local\temp\pip-fyauuh-build
Running command "C:\Program Files\TortoiseHg\hg.exe" update -q
Running setup.py (path:c:\users\marci\appdata\local\temp\pip-fyauuh-build\setup.py) egg_info for package from hg+http://bitbucket.org/pygame/pygame
WARNING, No "Setup" File Exists, Running "config.py"
Using WINDOWS configuration...
Path for SDL not found.
Too bad that is a requirement! Hand-fix the "Setup"
Path for FONT not found.
Path for IMAGE not found.
Path for MIXER not found.
Path for SMPEG not found.
Path for PNG not found.
Path for JPEG not found.
Path for PORTMIDI not found.
Path for FFMPEG not found.
Path for COPYLIB_tiff not found.
Path for COPYLIB_z not found.
Path for COPYLIB_vorbis not found.
Path for COPYLIB_ogg not found.
If you get compiler errors during install, doublecheck
the compiler flags in the "Setup" file.
Continuing With "setup.py"
Error with the "Setup" file,
perhaps make a clean copy from "Setup.in".
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "c:\users\marci\appdata\local\temp\pip-fyauuh-build\setup.py", line 174, in <module>
extensions = read_setup_file('Setup')
File "C:\Python27\Lib\distutils\extension.py", line 168, in read_setup_file
line = expand_makefile_vars(line, vars)
File "C:\Python27\Lib\distutils\sysconfig.py", line 387, in expand_makefile_vars
s = s[0:beg] + vars.get(m.group(1)) + s[end:]
TypeError: cannot concatenate 'str' and 'NoneType' objects
Complete output from command python setup.py egg_info:
WARNING, No "Setup" File Exists, Running "config.py"
Using WINDOWS configuration...
Path for SDL not found.
Too bad that is a requirement! Hand-fix the "Setup"
Path for FONT not found.
Path for IMAGE not found.
Path for MIXER not found.
Path for SMPEG not found.
Path for PNG not found.
Path for JPEG not found.
Path for PORTMIDI not found.
Path for FFMPEG not found.
Path for COPYLIB_tiff not found.
Path for COPYLIB_z not found.
Path for COPYLIB_vorbis not found.
Path for COPYLIB_ogg not found.
If you get compiler errors during install, doublecheck
the compiler flags in the "Setup" file.
Continuing With "setup.py"
Error with the "Setup" file,
perhaps make a clean copy from "Setup.in".
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "c:\users\marci\appdata\local\temp\pip-fyauuh-build\setup.py", line 174, in <module>
extensions = read_setup_file('Setup')
File "C:\Python27\Lib\distutils\extension.py", line 168, in read_setup_file
line = expand_makefile_vars(line, vars)
File "C:\Python27\Lib\distutils\sysconfig.py", line 387, in expand_makefile_vars
s = s[0:beg] + vars.get(m.group(1)) + s[end:]
TypeError: cannot concatenate 'str' and 'NoneType' objects
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in c:\users\marci\appdata\local\temp\pip-fyauuh-build
Exception information:
Traceback (most recent call last):
File "C:\Users\Marci\.virtualenvs\pyGame\lib\site-packages\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "C:\Users\Marci\.virtualenvs\pyGame\lib\site-packages\pip\commands\install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "C:\Users\Marci\.virtualenvs\pyGame\lib\site-packages\pip\req.py", line 1229, in prepare_files
req_to_install.run_egg_info()
File "C:\Users\Marci\.virtualenvs\pyGame\lib\site-packages\pip\req.py", line 325, in run_egg_info
command_desc='python setup.py egg_info')
File "C:\Users\Marci\.virtualenvs\pyGame\lib\site-packages\pip\util.py", line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in c:\users\marci\appdata\local\temp\pip-fyauuh-build

Categories