Giter VIP home page Giter VIP logo

Comments (5)

MartinBonner avatar MartinBonner commented on June 15, 2024 2

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.

ben9923 avatar ben9923 commented on June 15, 2024 1

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.

MartinBonner avatar MartinBonner commented on June 15, 2024

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.

kidrahahjo avatar kidrahahjo commented on June 15, 2024

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.

nitzmahone avatar nitzmahone commented on June 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.