Skip to content
This repository was archived by the owner on Feb 5, 2026. It is now read-only.
This repository was archived by the owner on Feb 5, 2026. It is now read-only.

bug?: rye sync fails with a C Extension dependency  #621

Open

Description

@onkoe

Steps to Reproduce

  1. rye add psutil or some other library that has an extension on psutil, as it utilizes the (technically now deprecated) stdio.h file with Python's C Extension module.
  2. Install C development libraries that include stdio.h.
  3. Attempt to run rye sync.
  4. Check out the error!
    • For me: /home/barrett/.rye/py/cpython@3.10.13/install/include/python3.10/Python.h:25:10: fatal error: stdio.h: No such file or directory

I'm also on a Mac M1 using Asahi Linux, which means that I had to install aarch64-linux-gnu-gcc to even get rye sync to run. Other programs haven't needed this, so I'm not quite sure why it's necessary here.

Also, as a note, this issue does occur across Python versions. I tested with both 3.10 and 3.11 through rye pin.

Expected Result

rye sync works properly, even on ARM64 machines using Linux.

Actual Result

rye sync explodes due to pip being unable to compile the extensions* with stdio.h. I assume this is due to a header file path issue with ARM64 devices, perhaps due to aarch64-linux-gnu-gcc not picking up on otherwise-working 'implied' paths. That's just a hunch, though. ☺️

(* I don't really know what I'm talking about with this, as I don't currently know how Python's C extensions work within libraries. Sorry for any errors!)

rye-sync-output.txt

pyproject.toml.txt

Version Info

barrett@fedora ~> rye --version
rye 0.21.0
commit: 0.21.0 (2e0e02459 2024-02-03)
platform: linux (aarch64)
self-python: cpython@3.12
symlink support: true

Here's a linux-hardware probe: https://linux-hardware.org/?probe=cc37ae5232
Repo link: https://github.com/onkoe/rovereye/tree/main/training

I'm happy to add any additional setup information or debugging info you may wish for me to provide. That said, it's just Fedora Workstation with some extra kernel drivers. :)

Stacktrace

No response

Activity

  1. mitsuhiko commented on Feb 8, 2024

    @mitsuhiko
    Contributor

    Unfortunately this is an issue with the python standalone builds today: https://gregoryszorc.com/docs/python-build-standalone/main/quirks.html#references-to-build-time-paths

    See also astral-sh/python-build-standalone#144

    I do not have a good solution today either, but it's something that longer term should be resolved. A "workaround" here is to register a non standalone python installation or to try to not rely on sysconfig.

  2. mitsuhiko commented on Feb 8, 2024

    @mitsuhiko
    Contributor

    At the very least this should go into the FAQ for now.

  3. onkoe commented on Feb 8, 2024

    @onkoe
    Author

    Thanks for the quick response!

    The following should work as a 'temporary' workaround:

    barrett@fedora ~> # remove rye from your path temporarily so we can find your system python installation
    barrett@fedora ~> echo $fish_user_paths | tr " " "\n" | nl
    
         1	/home/barrett/.rye/shims
         2	/home/barrett/.cargo/bin
    barrett@fedora ~> set --erase fish_user_paths[1]; which python3
    /usr/bin/python3
    
    barrett@fedora ~> # add rye back :)
    barrett@fedora ~> fish_add_path ~/.rye/shims/
    
    barrett@fedora ~> # add this system python as a rye toolchain
    barrett@fedora ~> rye toolchain register --name=py-sys-latest /usr/bin/python3
    Registered /usr/bin/python3 as py-sys-latest@3.12.1
    
    barrett@fedora ~> # navigate to your project and pin the new toolchain
    barrett@fedora ~/D/R/y/r/training (main)> rye pin py-sys-latest@3.12.1
    pinned py-sys-latest@3.12.1 in (project path)/.python-version
    
    barrett@fedora ~> # now run rye sync and everything should just work! 
    barrett@fedora ~/D/R/y/r/training (main)> rye sync
    Python version mismatch (found cpython@3.10.13, expected py-sys-latest@3.12.1), recreating.
    (...)

    Hope this helps someone later down the line. 😄

  4. added a commit that references this issue on Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or requestpython-build-standaloneIssues specific to python-build-standalone

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions