-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On a relocatable Python install, setuptools should compute the C include path correctly #3786
Comments
Hi! This seems like it might be a duplicate of #3657, which is now fixed in setuptools 67.2.0: Does newer setuptools resolve the issue for you? :-) |
I have the same issue and it is not fixed in setuptools 67.2.0 or later. However I can confirm that it works with 65.1.1 and is broken in 65.2.0. |
I believe that it is 9079e77 that breaks this. |
Hi @lordmauve , since you are already investigating, would you like to provide a PR to the |
I agree that this does look like a duplicate of #3657 and #3778, and pypa/distutils#178. I don't know why I'm still seeing this issue though if all of those are closed. |
In my case I was seeing it because build-time locations were in sysconfigdata. When we build ChimeraX we now set CONFINCLUDEPY, CONFINCLUDEDIR, INCLUDEPY, and INCLUDEDIR to the empty string. |
You can distribute CPython as a "relocatable" zip file, meaning, you just drop the zip file where-ever you want, and it works. For example, on Linux:
(You can also try this on macos or windows if you prefer.)
The resulting python knows where it is, where wheels should be installed, and all that; see
sysconfig.get_paths()
:Almost everything works great. But! When you use setuptools to compile a C extension, it uses the wrong include path:
Notice that the gcc command line has
-I/pyinstall/include/python3.11
, which is a path on the machine where this Python interpreter was built, not the path where it's installed, or the path returned bysysconfig.get_paths()
.I wasn't able to entirely follow where setuptools gets its include path from, but I think it's ultimately coming from
distutils.sysconfig.get_python_inc
, which invokes a number of strategies to find the include directory, but they're all based on static compile-time data, rather than the actual runtime location of the Python interpreter.This is the only problem I've managed to find so far with these relocatable interpreters, so it would be nice if we could fix setuptools to use the correct include path :-).
The text was updated successfully, but these errors were encountered: