Repository navigation
Ensure venv works with source builds when using --copies #92897
Description
Activity
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on May 17, 2022 - added a commit that references this issue
on May 17, 2022 - addedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
on May 17, 2022 An example error when building psutil.
running build_ext building 'psutil._psutil_windows' extension creating build\temp.win-amd64-3.12 creating build\temp.win-amd64-3.12\Release creating build\temp.win-amd64-3.12\Release\psutil creating build\temp.win-amd64-3.12\Release\psutil\arch creating build\temp.win-amd64-3.12\Release\psutil\arch\windows C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=590 -DPSUTIL_WINDOWS=1 -D_WIN32_WINNT=0x01000 -D_AVAIL_WINVER_=0x01000 -D_CRT_SECURE_NO_WARNINGS -DPSAPI_VERSION=1 -IC:\Users\Jeremy\Source\pyperformance\include -IC:\Public\Devel\cpython\main\include -IC:\Public\Devel\cpython\main\Include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\ATLMFC\include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt /Tcpsutil/_psutil_common.c /Fobuild\temp.win-amd64-3.12\Release\psutil/_psutil_common.obj _psutil_common.c C:\Public\Devel\cpython\main\include\Python.h(12): fatal error C1083: Cannot open include file: 'pyconfig.h': No such file or directory error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.30.30705\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2After the PR, this builds without error (kinda). There is a bug in setuptools that causes an additional error. This can be worked around by setting the environment variable
SETUPTOOLS_USE_DISTUTILS=no.I'll add that prior to 3.8 this problem did not occur. Just that source builds on Windows are a rare thing to start with much less compiling in virtual environments from a source build so this change in behavior has gone relatively unnoticed.
- added 4 commits that reference this issue
on Jul 5, 2022 Closing, as PRs merged for
mainand3.11branches.Is there any plan for the removal of the
check_homeargument insysconfig.is_python_build, whose deprecation was introduced in GH-92899?Keeping deprecated as-is doesn't really create much maintenance burden, and removing it can break user code, though searching for such usages on Github didn't yield any results. Perhaps we could schedule its removal for 3.15 or 3.16, and clearly state that in the deprecation warning? What do you folks think?
The deprecated check_home parameter can be removed in Python 3.15.
Reacted by Filipe Laíns- added a commit that references this issue
on Mar 14, 2025 - added a commit that references this issue
on May 11, 2025
Currently a venv created with
--copiesor on Windows doesn't respect thesysconfig.is_python_build()property of the creating interpreter. This leads to compilation errors when attempting to build extensions in the virtual environment.Linked PRs
check_homeinDoc/whatsnew/3.15.rst#133815