Comments (5)
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.
from pyyaml.
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.
from pyyaml.
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.
from pyyaml.
Update Its related to #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
from pyyaml.
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".
from pyyaml.
Related Issues (20)
- libyaml-based builds segfault on Python 3.13.0a1 HOT 1
- Clarify that load_all methods return a generator, not a sequence HOT 1
- Failure to import HOT 2
- Support `str` subclasses in libyaml extension
- CSafeDumper doesn't appear to respect `allow_unicode=True`
- failed installing dependencies on WSL2 HOT 1
- bug? some string constants are getting printed as ints HOT 2
- yaml dump outputs not-to-spec keys HOT 2
- yaml-6.0.1 ==> cython-3.0.7
- How to install via pip using `--without-libyaml` when `--install-option` is deprecated? HOT 2
- PyYaml missing AArch64 wheel for Python 3.12 only HOT 1
- Result of safe_load_all is not writable with safe_dump_all HOT 4
- Install PyYAML 6.0 from source results into failure: ERROR: No matching distribution found for wheel HOT 1
- Unable to install in Python 3.12 environment HOT 1
- Yaml on dumping giving different result
- RFE: port to `cython` 3.x HOT 2
- Depth first firing of generators HOT 1
- Unable to install due to dependency on setuptools - help please? HOT 2
- Provide wheel for `musllinux` `arm64`
- [Joke Issue] Attempt to write the most complex YAML file in human history
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyyaml.