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

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.

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

Problem with installing pygame, python 3.11.1 [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.
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.

Yet Another DLIB installation problem despite CMake installed

I have CMake tool installed using Visual STudio Build tools 2019. I have rechecked my ENV variables multiple times.
I have tried installation using the Source. I have followed this and all the other discussions as well.
Here is the detailed error
running install
C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\command\easy_install.py:160: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running bdist_egg
running egg_info
writing tools/python\dlib.egg-info\PKG-INFO
writing dependency_links to tools/python\dlib.egg-info\dependency_links.txt
writing top-level names to tools/python\dlib.egg-info\top_level.txt
package init file 'tools\python\dlib\__init__.py' not found (or not a regular file)
reading manifest file 'tools/python\dlib.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'tools\python\build*'
no previously-included directories found matching 'dlib\cmake_utils\*\build*'
no previously-included directories found matching 'dlib\test'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
writing manifest file 'tools/python\dlib.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\setup.py:129: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
if LooseVersion(cmake_version) < '3.1.0':
Building extension for Python 3.10.2 (tags/v3.10.2:a58ebcc, Jan 17 2022, 14:12:15) [MSC v.1929 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\lib
.win-amd64-3.10 -DPYTHON_EXECUTABLE=C:\Users\asus\PycharmProjects\drowsiness-detection\envt\Scripts\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\lib.win-amd64-3.10 -A x64'
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.22000.
CMake Error at CMakeLists.txt:14 (project):
Failed to run MSBuild command:
C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/MSBuild/Current/Bin/MSBuild.exe
to get the value of VCTargetsPath:
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 27-Feb-22 6:58:45 PM.
Project "C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\temp.win-amd64-3.10\Release\CMakeFiles\3.18.4\VCTargetsPath.vcxproj" on node 1 (default targets).
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.Cpp.WindowsSDK.targets(46,5): error MSB8036: The Windows SDK version 10.0.17763.0
was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\temp.win-amd64-3.10\Release\CMakeFiles\3.18.4\VCTargetsPath.vcxproj]
Done Building Project "C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\temp.win-amd64-3.10\Release\CMakeFiles\3.18.4\VCTargetsPath.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\temp.win-amd64-3.10\Release\CMakeFiles\3.18.4\VCTargetsPath.vcxproj" (default target) (1) ->
(_CheckWindowsSDKInstalled target) ->
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.Cpp.WindowsSDK.targets(46,5): error MSB8036: The Windows SDK version 10.0.17763
.0 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\temp.win-amd64-3.10\Release\CMakeFiles\3.18.4\VCTargetsPath.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.21
Exit code: 1
-- Configuring incomplete, errors occurred!
See also "C:/Users/asus/Downloads/dlib-19.23.0/dlib-19.23.0/build/temp.win-amd64-3.10/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\setup.py", line 222, in <module>
setup(
File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\__init__.py", line 155, in setup
return distutils.core.setup(**attrs)
File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\_distutils\core.py", line 148, in setup
return run_commands(dist)
File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\_distutils\core.py", line 163, in run_commands
dist.run_commands()
File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\_distutils\dist.py", line 967, in run_commands
self.run_command(cmd)
File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
cmd_obj.run()
File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\command\install.py", line 74, in run
self.do_egg_install()
File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\command\install.py", line 116, in do_egg_install
self.run_command('bdist_egg')
File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\_distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
self.build_extension(ext)
File "C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\setup.py", line 171, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\asus\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\asus\\Downloads\\dlib-19.23.0\\dlib-19.23.0\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\asus\\Downloads\\dlib-19.23.0\\dlib-19.23.0\\build\\lib.win-amd64-3.10', '-DPYTHON_EXECUTABLE=C:\\Users\\asus\\PycharmProjects\\drowsiness-detection\\envt\\Scripts\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\asus\\Downloads\\dlib-19.23.0\\dlib-19.23.0\\build\\lib.win-amd64-3.10', '-A', 'x64']' returned non-zero exit status 1.
I am not using Anacodna and I am on Windows 10 platform. Any help is much appreciated.
Do you have Windows SDK version 10.0.17763.0 installed? It should look something like this screenshot:

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

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

Categories