pyyaml: Build error with setuptools 0.68.0
I think this might be caused from an inadvertent upgrade in my system of virtualenv from 20.23.1 to 20.24.0, which included an upgrade of setuptools from 67.8 to 68.
This was with Alpine (and Python 3.11.4) but the problem seems to be setuptools 68:
ChefBuildError
[2023-07-17T15:25:18.341Z] Backend subprocess exited when trying to invoke get_requires_for_build_wheel
running egg_info
writing lib/PyYAML.egg-info/PKG-INFO
writing dependency_links to lib/PyYAML.egg-info/dependency_links.txt
writing top-level names to lib/PyYAML.egg-info/top_level.txt
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/usr/local/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "/tmp/tmp0l7lnl_n/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/tmp0l7lnl_n/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
self.run_setup()
File "/tmp/tmp0l7lnl_n/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 338, in run_setup
exec(code, locals())
File "<string>", line 288, in <module>
File "/tmp/tmp0l7lnl_n/.venv/lib/python3.11/site-packages/setuptools/__init__.py", line 107, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/tmp0l7lnl_n/.venv/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "/tmp/tmp0l7lnl_n/.venv/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/tmp/tmp0l7lnl_n/.venv/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/tmp/tmp0l7lnl_n/.venv/lib/python3.11/site-packages/setuptools/dist.py", line 1234, in run_command
super().run_command(command)
File "/tmp/tmp0l7lnl_n/.venv/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/tmp/tmp0l7lnl_n/.venv/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 314, in run
self.find_sources()
File "/tmp/tmp0l7lnl_n/.venv/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 322, in find_sources
mm.run()
File "/tmp/tmp0l7lnl_n/.venv/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 551, in run
self.add_defaults()
File "/tmp/tmp0l7lnl_n/.venv/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 589, in add_defaults
sdist.add_defaults(self)
File "/tmp/tmp0l7lnl_n/.venv/lib/python3.11/site-packages/setuptools/command/sdist.py", line 104, in add_defaults
super().add_defaults()
File "/tmp/tmp0l7lnl_n/.venv/lib/python3.11/site-packages/setuptools/_distutils/command/sdist.py", line 251, in add_defaults
self._add_defaults_ext()
File "/tmp/tmp0l7lnl_n/.venv/lib/python3.11/site-packages/setuptools/_distutils/command/sdist.py", line 336, in _add_defaults_ext
self.filelist.extend(build_ext.get_source_files())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<string>", line 204, in get_source_files
File "/tmp/tmp0l7lnl_n/.venv/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
raise AttributeError(attr)
AttributeError: cython_sources
at /usr/local/lib/python3.11/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:
Note: This error originates from the build backend, and is likely not a problem with poetry but with pyyaml (6.0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "pyyaml (==6.0)"'.
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 9
- Comments: 15
Commits related to this issue
- Upgrade PyYAML to 6.0.1 This was causing install issues with newer versions of Python / setuptools; see https://github.com/yaml/pyyaml/issues/723. Thanks to Rui Chen <rui@chenrui.dev> for reporting ... — committed to anishathalye/dotbot by anishathalye 10 months ago
- Upgrade PyYAML to 6.0.1 This was causing install issues with newer versions of Python / setuptools; see https://github.com/yaml/pyyaml/issues/723. Thanks to Rui Chen <rui@chenrui.dev> for reporting ... — committed to anishathalye/dotbot by anishathalye 10 months ago
- Downgrade PyYAML to fix build issue See the following GitHub issues for more info: - https://github.com/yaml/pyyaml/issues/724 - https://github.com/yaml/pyyaml/issues/601 - https://github.com/yaml/p... — committed to hiboxsystems/marge-bot by slovdahl 9 months ago
- Downgrade PyYAML to fix build issue (#41) See the following GitHub issues for more info: - https://github.com/yaml/pyyaml/issues/724 - https://github.com/yaml/pyyaml/issues/601 - https://github.... — committed to hiboxsystems/marge-bot by slovdahl 9 months ago
- bump pyyaml (https://github.com/yaml/pyyaml/issues/723) — committed to kiwazo-be/powerdns-api-proxy by franklouwers 5 months ago
@tommyjcarpenter, I think this problem occurs in other setuptools versions as well. I got this error from updating setuptools from 59.6.0 to 67.8.0.
But after I fixed the PyYAML version at 5.3.1. Problem solved.
Update: update PyYAML to 6.0.1 also can solve the problem.
I can confirm using 5.3.1 works for me
I was trying to install awscli in version 1.22.11 and it needs PyYAML too, the version 5.3.1 was working fine, so maybe this is a help for someone with a similar problem
Looks like the error happens at https://github.com/yaml/pyyaml/blob/957ae4d495cf8fcb5475c6c2f1bce801096b68a5/setup.py#L203-L206
@phillipuniverse Cython != CPython
the title of this issue is wrong, its not 0.68.0
we were able to solve this by moving to pyyaml 6.0.1 and setup tools 65
@mcdonnnj agree, I’ll close this one to consolidate conversation.
yes I think using 5.3.1 is the only way
I’m just using poetry and hitting this error along with a bunch of other’s. #601 is getting a lot of traffic related to this too.
Does anyone know of a workaround that’d work with poetry?