You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 5, 2026. It is now read-only.
Repository navigation
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
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.
Install C development libraries that include stdio.h.
Attempt to run rye sync.
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!)
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. :)
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.
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.
(...)
Activity
mitsuhiko commentedon Feb 8, 2024
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.
mitsuhiko commentedon Feb 8, 2024
At the very least this should go into the FAQ for now.
onkoe commentedon Feb 8, 2024
Thanks for the quick response!
The following should work as a 'temporary' workaround:
Hope this helps someone later down the line. 😄
Add an FAQ entry for issue #621
Add an FAQ entry for issue astral-sh#621