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
venv assumes header files in sys._home + '/Include' #59571
Comments
For Unix I follow the practice suggested in README of running configure from a subdir of the main python directory, eg
But if I create a venv then I cannot use it to compile C extensions because the include dirs are wrong, eg
The problem seems to be that distutils.sysconfig.get_python_inc() assumes that if sys._home is set (as it is in a virtual env) then the standard header files can be found in sys._home + '/Include'. But for my venv this is wrong, since sys._home is "/home/user/Repos/cpython/release" and "/home/user/Repos/cpython/release/Include" is empty. Instead get_python_inc() should return "/home/user/Repos/cpython/Include". BTW, a seperate issue seems to be that ${venv}/include is not added to the list of include dirs used when compiling. |
The attached patch seems to fix the problem. |
Updated patch. Old one broke test_distutils... |
New changeset 998c8a8f2aea by Vinay Sajip in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: