Pygame error metadata generation failed

Environment: Operating system: Windows 11 Python version: Python 3.11.0b4 Current behavior: error: metadata-generation-failed Steps to reproduce: (Using Python 3.11.0b4) pip install pygame Stack tr...

distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.3 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

Pygame doesn’t distribute prebuilt distributions for beta versions of Python. So for 3.11, you have to build from source. https://www.pygame.org/wiki/CompileWindows

That’s also doesn’t work for me, same error

Stack trace/error output/other error logs:

C:WindowsSystem32>python3.11 -m pip install setuptools
Requirement already satisfied: setuptools in c:userstuankappdatalocalpackagespythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0localcachelocal-packagespython311site-packages (63.2.0)

C:WindowsSystem32>git clone https://github.com/pygame/pygame.git
fatal: destination path 'pygame' already exists and is not an empty directory.

C:WindowsSystem32>cd pygame

C:WindowsSystem32pygame>python3.11 -m pip install setuptools requests wheel numpy -U
Requirement already satisfied: setuptools in c:userstuankappdatalocalpackagespythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0localcachelocal-packagespython311site-packages (63.2.0)
Requirement already satisfied: requests in c:userstuankappdatalocalpackagespythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0localcachelocal-packagespython311site-packages (2.28.1)
Requirement already satisfied: wheel in c:userstuankappdatalocalpackagespythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0localcachelocal-packagespython311site-packages (0.37.1)
Requirement already satisfied: numpy in c:userstuankappdatalocalpackagespythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0localcachelocal-packagespython311site-packages (1.23.1)
Requirement already satisfied: charset-normalizer<3,>=2 in c:userstuankappdatalocalpackagespythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0localcachelocal-packagespython311site-packages (from requests) (2.1.0)
Requirement already satisfied: idna<4,>=2.5 in c:userstuankappdatalocalpackagespythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0localcachelocal-packagespython311site-packages (from requests) (3.3)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:userstuankappdatalocalpackagespythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0localcachelocal-packagespython311site-packages (from requests) (1.26.10)
Requirement already satisfied: certifi>=2017.4.17 in c:userstuankappdatalocalpackagespythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0localcachelocal-packagespython311site-packages (from requests) (2022.6.15)

C:WindowsSystem32pygame>python3.11 -m buildconfig --download
Using WINDOWS configuration...

WARNING:root:Using the SDL libraries in "prebuilt-x64".
Path for SDL: prebuilt-x64SDL2-2.0.22
...Library directory for SDL: prebuilt-x64/SDL2-2.0.22/lib/x64
...Include directory for SDL: prebuilt-x64/SDL2-2.0.22/include
Path for FONT: prebuilt-x64SDL2_ttf-2.0.19
...Library directory for FONT: prebuilt-x64/SDL2_ttf-2.0.19/lib/x64
...Include directory for FONT: prebuilt-x64/SDL2_ttf-2.0.19/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.22/lib/x64/SDL2.dll
DLL for SDL2_ttf: prebuilt-x64/SDL2_ttf-2.0.19/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: prebuilt-x64
...Library directory for FREETYPE: prebuilt-x64/lib
...Include directory for FREETYPE: prebuilt-x64/include
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/lib/freetype.dll
DLL for png: prebuilt-x64/SDL2_image-2.0.5/lib/x64/libpng16-16.dll
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:WindowsSystem32pygamebuildconfig__main__.py", line 2, in <module>
    main()
  File "C:WindowsSystem32pygamebuildconfigconfig.py", line 231, in main
    deps = CFG.main(**kwds, auto_config=auto)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:WindowsSystem32pygamebuildconfigconfig_win.py", line 500, in main
    return setup_prebuilt_sdl2(prebuilt_dir)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:WindowsSystem32pygamebuildconfigconfig_win.py", line 460, in setup_prebuilt_sdl2
    DEPS.configure()
  File "C:WindowsSystem32pygamebuildconfigconfig_win.py", line 336, in configure
    from . import vstools
  File "C:WindowsSystem32pygamebuildconfigvstools.py", line 8, in <module>
    compiler.initialize()
  File "C:UserstuankAppDataLocalPackagesPythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0LocalCachelocal-packagesPython311site-packagessetuptools_distutilsmsvc9compiler.py", line 393, in initialize
    vc_env = query_vcvarsall(VERSION, plat_spec)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:UserstuankAppDataLocalPackagesPythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0LocalCachelocal-packagesPython311site-packagessetuptoolsmsvc.py", line 140, in msvc9_query_vcvarsall
    return EnvironmentInfo(arch, ver).return_env()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:UserstuankAppDataLocalPackagesPythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0LocalCachelocal-packagesPython311site-packagessetuptoolsmsvc.py", line 1740, in return_env
    [self.VCIncludes,
     ^^^^^^^^^^^^^^^
  File "C:UserstuankAppDataLocalPackagesPythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0LocalCachelocal-packagesPython311site-packagessetuptoolsmsvc.py", line 1282, in VCIncludes
    return [join(self.si.VCInstallDir, 'Include'),
                 ^^^^^^^^^^^^^^^^^^^^
  File "C:UserstuankAppDataLocalPackagesPythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0LocalCachelocal-packagesPython311site-packagessetuptoolsmsvc.py", line 840, in VCInstallDir
    raise distutils.errors.DistutilsPlatformError(msg)
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.3 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

The Error “error: metadata-generation-failed”, is an error that is invoked when you are working on python and are trying to install the artic package via pip install gensim. Given below is the snippet of the error you might get:

error: metadata-generation-failed

I would like to share with you the steps I took to fix the “error: metadata-generation-failed”

The error, “error: metadata-generation-failed” is seen because, of a recent change in pip, you can simple sove the error by adding –use-deprecated=backtrack-on-build-failures during installation.

The detailed solution to fix the error “error: metadata-generation-failed”, is given below:

How to fix “error: metadata-generation-failed” Python Error?

To fix the error, you will have to add the following command during the installation of your package: –use-deprecated=backtrack-on-build-failures. It would fix the error metadata-generation-failed Python.

To fix the error, “error: metadata-generation-failed”, you will have to follow one the steps mentioned below:

This error is caused because of a change in pip, you can add the following command during the installation of your package:

--use-deprecated=backtrack-on-build-failures

For your reference we will take an example of installing the numpy package, normally you would use pip install numpy, but with the new way you would use the following code:

pip install numpy --use-deprecated=backtrack-on-build-failures

The above method should work fine for windows systems, if you still face the error in your linux based systems then you will have to follow the below mentioned commands and try the above steps again:

sudo apt-get install python-dev 
sudo apt-get install build-essential
python -m pip install -U pip or python3 -m pip install -U pip 
pip3 install --upgrade setuptools

This should fix the error “error: metadata-generation-failed”.

Conclusion

To fix the error “error: metadata-generation-failed”, you will have to add the following command during the installation of your package: –use-deprecated=backtrack-on-build-failures.

Also Read:

How to Fix ‘Party Service Unavailable’ in World War 3
How to Fix ‘connected to wrong server’ World War 3
How to Fix ‘Client authentication error’ World War 3
How to Fix ‘Accepting friend requests causes game to crash’ World War 3
How to Fix ‘Accepting party invites causes game to crash’ World War 3
How to Fix ‘initializing interface timeout’ World War 3
How to Fix ‘stuck on map loading screens’
How to Fix ‘Client Authentication Failure’ in World War 3
How to Fix ‘THE TOKEN IS INVALID’ in World War 3
How to Fix World War 3 Error 40302

20.01.2023

394 Просмотры

Ошибка «encountered error while generating package metadata» при установке модуля для Python 3.11. Как исправить эту ошибку и установить модуль для Питон.

Encountered error while generating package metadata возникает по нескольким причинам:

  1. Наличие устаревшей версии pipи setuptools.
  2. Наличие версии Python, которая не поддерживается пакетом, который вы пытаетесь установить.
  3. Ошибка в написании имени пакета.
  4. Отсутствуют зависимости.

Первое, что вы должны попробовать, это запустить pip install команду с –use-deprecated параметром.

Этот –use-deprecated параметр позволяет нам использовать старое поведение распознавателя при установке модулей.

Если у вас более старая версия pip, вы должны установить –use-deprecated параметр на backtrack-on-build-failures.

Если предложения не помогли, прочитайте конец сообщения об ошибке.

Она может содержать такую информацию, как: “Ошибка выполнения: невозможно установить на Python версии 3.11.0; поддерживаются только версии> = 3.7, <3.11”.

В этом случае вы должны использовать версию Python, которая поддерживается пакетом.

Ваше сообщение об ошибке может также содержать отсутствующий пакет, который необходимо установить, например “Ошибка ModuleNotFoundError: нет модуля с именем ‘auxlib’”.

В этом случае вам необходимо установить auxlibпакет перед установкой другого пакета.

Другой распространенной причиной ошибки является неправильное написание имени пакета и попытка установить какой-либо сломанный, устаревший модуль по ошибке.

Если ни одно из предложений не помогло, попробуйте обновить свою pipверсию перед установкой пакета.

Убедитесь, что вы не пытаетесь установить модуль, встроенный в стандарт Библиотека Python, напримерemail, модуль. Вы можете напрямую импортировать встроенные модули без их установки.

При установке модуля pygame для Python возникает следующая ошибка:

error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output.

Ошибка при установке модуля, в данном случае это pygame, возникает по причине не совместимости версии Python и модуля pygame. В моем случае версия Питона самая свежая на момент написания статьи — 3.11, с которой конфликтует модуль pygame.

Для того чтобы установить модуль pygame на Python 3.11, нужно ввести следующую команду:

pip install pygame –pre

Тем самым мы устанавливаем предварительную версию модуля. По умолчанию pip находит только стабильные версии.

После чего модуль pygame будет успешно установлен.

Если ни одно из предложений не помогло, убедитесь, что ваша версия Python поддерживается пакетом.

Загрузка…

Не могу установить pip pygame и ряд других библиотек пишет

Ошибка

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
  ╰─> [43 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:UserstommyAppDataLocalTemppip-install-zwttycw2pygame_ae00c7691cae43efad0cf49aa0b5fe1esetup.py", line 359, in <module>
          buildconfig.config.main(AUTO_CONFIG)
        File "C:UserstommyAppDataLocalTemppip-install-zwttycw2pygame_ae00c7691cae43efad0cf49aa0b5fe1ebuildconfigconfig.py", line 225, in main
          deps = CFG.main(**kwds)
                 ^^^^^^^^^^^^^^^^
        File "C:UserstommyAppDataLocalTemppip-install-zwttycw2pygame_ae00c7691cae43efad0cf49aa0b5fe1ebuildconfigconfig_win.py", line 497, in main
          and download_win_prebuilt.ask(**download_kwargs):
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:UserstommyAppDataLocalTemppip-install-zwttycw2pygame_ae00c7691cae43efad0cf49aa0b5fe1ebuildconfigdownload_win_prebuilt.py", line 290, in ask
          update(x86=x86, x64=x64)
        File "C:UserstommyAppDataLocalTemppip-install-zwttycw2pygame_ae00c7691cae43efad0cf49aa0b5fe1ebuildconfigdownload_win_prebuilt.py", line 273, in update
          download_prebuilts(download_dir, x86=x86, x64=x64)
        File "C:UserstommyAppDataLocalTemppip-install-zwttycw2pygame_ae00c7691cae43efad0cf49aa0b5fe1ebuildconfigdownload_win_prebuilt.py", line 124, in download_prebuilts
          download_sha1_unzip(url, checksum, temp_dir, 1)
        File "C:UserstommyAppDataLocalTemppip-install-zwttycw2pygame_ae00c7691cae43efad0cf49aa0b5fe1ebuildconfigdownload_win_prebuilt.py", line 58, in download_sha1_unzip
          raise ValueError(
      ValueError: url:https://www.pygame.org/ftp/jpegsr9d.zip should have checksum:ed10aa2b5a0fcfe74f8a6f7611aeb346b06a1f99: Has:7fb085fd0732c08ba1c4a99e1a7143f722607b19:
      Making dir :prebuilt_downloads:
      Downloading... https://www.libsdl.org/release/SDL2-devel-2.0.18-VC.zip ed561079ec622b0bab5a9e02976f5d540b0622da
      Unzipping :prebuilt_downloadsSDL2-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_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.pygame.org/ftp/jpegsr9d.zip ed10aa2b5a0fcfe74f8a6f7611aeb346b06a1f99

      ---
      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.

Понравилась статья? Поделить с друзьями:
  • Putty fatal error network error connection refused raspberry
  • Pygame error display surface quit почему
  • Pygame error display mode not set
  • Pygame error cannot convert without pygame display initialized
  • Pygame display flip pygame error video system not initialized