pythondependenciesartificial-intelligence

Errors while trying to install gym-retro on vs code


I installed retro and made update for those pip install --upgrade setuptools_scm and pip install --upgrade setuptools wheel and I already have vs installer 2019 but I downloaded also 2022 but also didn't work this error appears:

pip install --use-pep517 gym-retro
>>
Collecting gym-retro
  Downloading gym-retro-0.7.1.tar.gz (168.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 168.7/168.7 MB 582.0 kB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [33 lines of output]
      Traceback (most recent call last):
        File "C:\Users\OMEN\Desktop\Street_Fighter\SF-env\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\OMEN\Desktop\Street_Fighter\SF-env\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\OMEN\Desktop\Street_Fighter\SF-env\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 149, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\OMEN\AppData\Local\Temp\pip-build-env-f5zhred0\overlay\Lib\site-packages\setuptools\build_meta.py", line 373, in prepare_metadata_for_build_wheel
          self.run_setup()
        File "C:\Users\OMEN\AppData\Local\Temp\pip-build-env-f5zhred0\overlay\Lib\site-packages\setuptools\build_meta.py", line 503, in run_setup
          super().run_setup(setup_script=setup_script)
        File "C:\Users\OMEN\AppData\Local\Temp\pip-build-env-f5zhred0\overlay\Lib\site-packages\setuptools\build_meta.py", line 318, in run_setup
          exec(code, locals())
        File "<string>", line 71, in <module>
        File "C:\Users\OMEN\AppData\Local\Temp\pip-build-env-f5zhred0\overlay\Lib\site-packages\setuptools\__init__.py", line 117, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\OMEN\AppData\Local\Temp\pip-build-env-f5zhred0\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 146, in setup
          _setup_distribution = dist = klass(attrs)
                                       ^^^^^^^^^^^^
        File "C:\Users\OMEN\AppData\Local\Temp\pip-build-env-f5zhred0\overlay\Lib\site-packages\setuptools\dist.py", line 283, in __init__
          _Distribution.__init__(self, dist_attrs)
        File "C:\Users\OMEN\AppData\Local\Temp\pip-build-env-f5zhred0\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 278, in __init__
          self.finalize_options()
        File "C:\Users\OMEN\AppData\Local\Temp\pip-build-env-f5zhred0\overlay\Lib\site-packages\setuptools\dist.py", line 635, in finalize_options
          ep(self)
        File "C:\Users\OMEN\AppData\Local\Temp\pip-build-env-f5zhred0\overlay\Lib\site-packages\setuptools\dist.py", line 655, in _finalize_setup_keywords
          ep.load()(self, ep.name, value)
        File "C:\Users\OMEN\AppData\Local\Temp\pip-build-env-f5zhred0\normal\Lib\site-packages\setuptools_scm\_integration\setuptools.py", line 82, in version_keyword
          assert isinstance(value, dict), "version_keyword expects a dict or True"
      AssertionError: version_keyword expects a dict or True
      [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.

How can I solve this


Solution

  • This problem mostly occurs because of the required Python version for the package.

    The required Python version for the latest gym-retro package is 3.8/3.7/3.6. So if your Python version is higher or lower than any of the mentioned versions, you need to uninstall and reinstall one of the following versions. It should work.

    Also, you can check this post for more solutions: Error while installing pytq5 with pip: Preparing metadata (pyproject.toml) did not run successfully