Closed MartinBonner closed 10 months ago
As a colleague has just got confused by this: 1. I am installing the tarball, not the wheel. 2. I am installing on Linux, not Mac.
Update Its related to https://github.com/yaml/pyyaml/issues/724 sorry for adding noise to this issue.
Hi I am facing an issue similar to this,
OS
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy
Python: 3.10.6
When I try to install "pyyaml<6", I get AttributeError: cython_sources
Existing packages in venv
(.venv) ~/src/test pip list
Package Version
---------- -------
pip 23.2.1
setuptools 68.1.2
Traceback for the issue
(.venv) ~/src/test pip install "pyyaml<6"
Collecting pyyaml<6
Downloading PyYAML-5.4.1.tar.gz (175 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 175.1/175.1 KB 4.1 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [62 lines of output]
/tmp/pip-build-env-gny7xrjs/overlay/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 "/home/hardikojha/src/test/.venv/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
main()
File "/home/hardikojha/src/test/.venv/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/hardikojha/src/test/.venv/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-gny7xrjs/overlay/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/pip-build-env-gny7xrjs/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-gny7xrjs/overlay/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/pip-build-env-gny7xrjs/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 107, in setup
return distutils.core.setup(**attrs)
File "/tmp/pip-build-env-gny7xrjs/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
File "/tmp/pip-build-env-gny7xrjs/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/tmp/pip-build-env-gny7xrjs/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/tmp/pip-build-env-gny7xrjs/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 1233, in run_command
super().run_command(command)
File "/tmp/pip-build-env-gny7xrjs/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-gny7xrjs/overlay/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 319, in run
self.find_sources()
File "/tmp/pip-build-env-gny7xrjs/overlay/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 327, in find_sources mm.run()
File "/tmp/pip-build-env-gny7xrjs/overlay/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 549, in run
self.add_defaults()
File "/tmp/pip-build-env-gny7xrjs/overlay/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 587, in add_defaults sdist.add_defaults(self)
File "/tmp/pip-build-env-gny7xrjs/overlay/lib/python3.10/site-packages/setuptools/command/sdist.py", line 113, in add_defaults
super().add_defaults()
File "/tmp/pip-build-env-gny7xrjs/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.py", line 251, in add_defaults
self._add_defaults_ext()
File "/tmp/pip-build-env-gny7xrjs/overlay/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/pip-build-env-gny7xrjs/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
raise AttributeError(attr)
AttributeError: cython_sources
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
You probably had a missing library when building Python so ctypes
isn't available.
Seems like you're using Ubuntu, try running sudo apt install libffi-dev
, then re-building Python (make sure you re-run ./configure ...
)
That said, wheel
could probably be updated to work without ctypes
being available in most of the flows, as it doesn't seem to always be necessary.
Yeah, this definitely looks like a case of "you don't have a fully-functional Python installation"- Debian-based distros are notorious for applying their own modularization to Python installations, so it's possible to end up with parts of the Python standard library missing or broken without the installation of some optional packages.
Regardless, the errors you're hitting here have nothing to do with PyYAML- they're several layers beneath it in code we don't control, and if your Python's ctypes
package isn't functional, your Python is going to be broken for many, many things.
Closing as "not our bug".
Thanks! That is very helpful. Given that we do something a bit weird with libffi (so that the resulting Python is easy to install on lots of distros), it is entirely plausible that the problem is mine, but your diagnosis helps me track down what has changed between Python 3.10 (which worked) and Python 3.11 (which doesn't).
I agree "closing" is the right action.
I have a freshly built copy of Python 3.11.4. I have installed Cython, pip, setuptools and wheel - but when I install PyYAML it fails.
Two things bother me about the following log:
(I'm running python3) and
(
uname -a
reportsLinux 30e04d129175 5.15.0-78-generic #85~20.04.1-Ubuntu SMP Mon Jul 17 09:42:39 UTC 2023 x86_64 GNU/Linux
)Note that
https://artifactory.ncipher.com/artifactory/api/pypi
is a passthrough to pypi.org.Other people seem to be able to install PyYAML 6.0.1, so what am I doing wrong?