Skip to content

Pyyaml error on poetry install #418

@hom-bahrani

Description

@hom-bahrani

Problem Description

I am trying to install cleanrl by following the installation guide https://docs.cleanrl.dev/get-started/installation/ but I am running into an error when poetry tries the Installing pyyaml step. I searched for this issue in the doc, current issues and discord channel but couldn't find anything.

Checklist

Current Behavior

I am working on an Ubuntu 22.04.2 LTS machine with Python 3.10.12. On cloning the repo and installing Poetry (I tried the latest version 1.6.1 and also 1.4.1 and 1.3.1, but experienced the same error with all versions) I get this error

(clearnrl) /content/cleanrl# /root/.local/bin/poetry install
Installing dependencies from lock file

Package operations: 77 installs, 1 update, 1 removal

  • Removing pip (22.3.1)
  • Installing numpy (1.21.6)
  • Installing certifi (2023.5.7)
  • Installing charset-normalizer (3.1.0)
  • Installing idna (3.4)
  • Installing markupsafe (2.1.2)
  • Installing pyasn1 (0.5.0)
  • Installing six (1.16.0)
  • Installing smmap (5.0.0)
  • Installing typing-extensions (4.5.0)
  • Installing urllib3 (1.26.15)
  • Installing absl-py (1.4.0)
  • Installing cachetools (5.3.0)
  • Installing cloudpickle (2.2.1)
  • Installing cycler (0.11.0)
  • Installing fonttools (4.38.0)
  • Installing gitdb (4.0.10)
  • Installing gym-notices (0.0.8)
  • Installing kiwisolver (1.4.4)
  • Installing oauthlib (3.2.2)
  • Installing packaging (23.1)
  • Installing pillow (9.5.0)
  • Installing pyasn1-modules (0.3.0)
  • Installing pygments (2.15.1)
  • Installing pyparsing (3.0.9)
  • Installing python-dateutil (2.8.2)
  • Installing pytz (2023.3)
  • Installing pyyaml (5.4.1): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke get_requires_for_build_wheel
  
  /tmp/tmpv0b7jscm/.venv/lib/python3.10/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in `setup.cfg`
  !!
  
          ********************************************************************************
          The license_file parameter is deprecated, use license_files instead.
  
          By 2023-Oct-30, you need to update your project and remove deprecated calls
          or your builds will no longer be supported.
  
          See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
          ********************************************************************************
  
  !!
    parsed = self.parsers.get(option_name, lambda x: x)(value)
  running egg_info
  writing lib3/PyYAML.egg-info/PKG-INFO
  writing dependency_links to lib3/PyYAML.egg-info/dependency_links.txt
  writing top-level names to lib3/PyYAML.egg-info/top_level.txt
  Traceback (most recent call last):
    File "/root/.local/share/pypoetry/venv/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/root/.local/share/pypoetry/venv/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/root/.local/share/pypoetry/venv/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/tmp/tmpv0b7jscm/.venv/lib/python3.10/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
    File "/tmp/tmpv0b7jscm/.venv/lib/python3.10/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
      self.run_setup()
    File "/tmp/tmpv0b7jscm/.venv/lib/python3.10/site-packages/setuptools/build_meta.py", line 341, in run_setup
      exec(code, locals())
    File "<string>", line 271, in <module>
    File "/tmp/tmpv0b7jscm/.venv/lib/python3.10/site-packages/setuptools/__init__.py", line 103, in setup
      return distutils.core.setup(**attrs)
    File "/tmp/tmpv0b7jscm/.venv/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
    File "/tmp/tmpv0b7jscm/.venv/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/tmp/tmpv0b7jscm/.venv/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/tmp/tmpv0b7jscm/.venv/lib/python3.10/site-packages/setuptools/dist.py", line 989, in run_command
      super().run_command(command)
    File "/tmp/tmpv0b7jscm/.venv/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/tmpv0b7jscm/.venv/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 318, in run
      self.find_sources()
    File "/tmp/tmpv0b7jscm/.venv/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 326, in find_sources
      mm.run()
    File "/tmp/tmpv0b7jscm/.venv/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 548, in run
      self.add_defaults()
    File "/tmp/tmpv0b7jscm/.venv/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 586, in add_defaults
      sdist.add_defaults(self)
    File "/tmp/tmpv0b7jscm/.venv/lib/python3.10/site-packages/setuptools/command/sdist.py", line 113, in add_defaults
      super().add_defaults()
    File "/tmp/tmpv0b7jscm/.venv/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.py", line 251, in add_defaults
      self._add_defaults_ext()
    File "/tmp/tmpv0b7jscm/.venv/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.py", line 336, in _add_defaults_ext
      self.filelist.extend(build_ext.get_source_files())
    File "<string>", line 201, in get_source_files
    File "/tmp/tmpv0b7jscm/.venv/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
      raise AttributeError(attr)
  AttributeError: cython_sources
  

  at ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/chef.py:147 in _prepare
      143│ 
      144│                 error = ChefBuildError("\n\n".join(message_parts))
      145│ 
      146│             if error is not None:
    → 147│                 raise error from None
      148│ 
      149│             return path
      150│ 
      151│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Expected Behavior

A successful installation of cleanrl

Possible Solution

As a workaround, I tried installing pyyaml manually using pip without the PEP 517 build process, but that did not solve the issue

pip install --no-use-pep517 pyyaml==5.4.1

If I downgrade the version of pyyaml==5.3.1 this error goes away but there are other packages that depend on pyyaml==5.4.1 so the installation fails again

Steps to Reproduce

  1. git clone https://github.com/vwxyzjn/cleanrl.git
  2. curl -sSL https://install.python-poetry.org | python3
  3. poetry install

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions