Skip to content

PyYaml installation fails #53

@BigBlueHat

Description

@BigBlueHat

I hit this roadblock when running poetry install:

  - Installing pyyaml (5.4.1): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke get_requires_for_build_wheel

  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 "/home/byoung/.local/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
      main()
    File "/home/byoung/.local/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in main
      json_out["return_val"] = hook(**hook_input["kwargs"])
    File "/home/byoung/.local/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/tmp/tmpmzymfply/.venv/lib/python3.10/site-packages/setuptools/build_meta.py", line 334, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=[])
    File "/tmp/tmpmzymfply/.venv/lib/python3.10/site-packages/setuptools/build_meta.py", line 304, in _get_build_requires
      self.run_setup()
    File "/tmp/tmpmzymfply/.venv/lib/python3.10/site-packages/setuptools/build_meta.py", line 320, in run_setup
      exec(code, locals())
    File "<string>", line 271, in <module>
    File "/tmp/tmpmzymfply/.venv/lib/python3.10/site-packages/setuptools/__init__.py", line 117, in setup
      return distutils.core.setup(**attrs)
    File "/tmp/tmpmzymfply/.venv/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 186, in setup
      return run_commands(dist)
    File "/tmp/tmpmzymfply/.venv/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 202, in run_commands
      dist.run_commands()
    File "/tmp/tmpmzymfply/.venv/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 983, in run_commands
      self.run_command(cmd)
    File "/tmp/tmpmzymfply/.venv/lib/python3.10/site-packages/setuptools/dist.py", line 999, in run_command
      super().run_command(command)
    File "/tmp/tmpmzymfply/.venv/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command
      cmd_obj.run()
    File "/tmp/tmpmzymfply/.venv/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 312, in run
      self.find_sources()
    File "/tmp/tmpmzymfply/.venv/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 320, in find_sources
      mm.run()
    File "/tmp/tmpmzymfply/.venv/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 543, in run
      self.add_defaults()
    File "/tmp/tmpmzymfply/.venv/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 581, in add_defaults
      sdist.add_defaults(self)
    File "/tmp/tmpmzymfply/.venv/lib/python3.10/site-packages/setuptools/command/sdist.py", line 109, in add_defaults
      super().add_defaults()
    File "/tmp/tmpmzymfply/.venv/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.py", line 239, in add_defaults
      self._add_defaults_ext()
    File "/tmp/tmpmzymfply/.venv/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.py", line 324, in _add_defaults_ext
      self.filelist.extend(build_ext.get_source_files())
    File "<string>", line 201, in get_source_files
    File "/tmp/tmpmzymfply/.venv/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 120, in __getattr__
      raise AttributeError(attr)
  AttributeError: cython_sources


  at ~/.local/lib/python3.10/site-packages/poetry/installation/chef.py:164 in _prepare
      160│
      161│                 error = ChefBuildError("\n\n".join(message_parts))
      162│
      163│             if error is not None:
    → 164│                 raise error from None
      165│
      166│             return path
      167│
      168│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with PyYAML (5.4.1) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "pyyaml (==5.4.1)"'.

I was able to install PyYaml v6 without issue following these instructions: yaml/pyyaml#724 (comment)

However, due to PyYaml coming in through out of date secondary dependencies (https://github.com/Neoteroi/essentials-openapi/ afiact), fixing the issue looks like upgrading one (or more) dependencies.

Hopefully an easy fix for someone familiar with the project.

Thanks!
🎩

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions