This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Virtual environment sysconfig.get_path() and distutils.sysconfig.get_python_inc() reports base Python include directory
Type: behavior Stage: resolved
Components: Distutils, Library (Lib) Versions: Python 3.7, Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: Mark Campanelli, dstufft, eric.araujo, steve.dower, uranusjr
Priority: normal Keywords:

Created on 2019-03-20 16:53 by Mark Campanelli, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg338494 - (view) Author: Mark Campanelli (Mark Campanelli) Date: 2019-03-20 16:53
On Windows 10 64bit, using virtualenv in Python 2.7.15 or venv in Python 3.7.2, calling distutils.sysconfig.get_python_inc() returns the path to the include directory for the (respective) Python base installation instead of the include directory installed with the virtual environment. This happens regardless of the True/False value of the  plat_specific argument. I would expect the virtual environment's include directory to be returned.
msg357851 - (view) Author: Tzu-ping Chung (uranusjr) * Date: 2019-12-05 13:39
I can replicate this on Linux as well. Furthormore, sysconfig.get_path('include') also returns the global path.
msg386258 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-02-03 18:07
Distutils is now deprecated (see PEP 632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils.

If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at https://github.com/pypa/setuptools
History
Date User Action Args
2022-04-11 14:59:12adminsetgithub: 80564
2021-02-03 18:07:53steve.dowersetstatus: open -> closed

nosy: + steve.dower
messages: + msg386258

resolution: out of date
stage: resolved
2019-12-05 13:39:03uranusjrsettitle: In Windows 10 virtual environments distutils.sysconfig.get_python_inc() reports base Python include directory -> Virtual environment sysconfig.get_path() and distutils.sysconfig.get_python_inc() reports base Python include directory
nosy: + uranusjr

messages: + msg357851

components: + Library (Lib)
2019-03-20 16:53:48Mark Campanellicreate