Free-threaded libraries should be in lib/python3.14t
(configure)
#121103
Labels
3.13
bugs and security fixes
3.14
new features, bugs and security fixes
release-blocker
topic-free-threading
type-bug
An unexpected behavior, bug, or error
Bug report
Background
When using
configure
based Python installations, if two the free-threaded and default builds are installed to the same prefix, they will share the samelib
directory. For example, when installing Python 3.14 the structure looks like:The include directories are not shared, which is good because they have different
pyconfig.h
files.However, the
lib/python3.14
is shared, which means that packages installed in the default build may be partially available in the free-threaded build and vice versa. This was unintended and can cause problems, such as confusing error messages and crashes.For example, if I run:
python3.14 -m pip install numpy
(install in default build)python3.14t -c "import numpy"
I get a confusing error message:
Error importing numpy: you should not try to import numpy from its source directory...
It would be better if installing NumPy in the default build did not make it available in the free-threaded build and vice versa.
Proposal
We should add the ABI suffix to the lib directory, like we do for the include directory. Specifically, we should use
python$(LDVERSION)
instead ofpython$(VERSION)
.For example, the free-threaded build would uselib/python3.14t
in Python 3.14.Debug builds have
d
as part of their ABI suffix (and LDVERSION), so this would incidentally affect installations of the debug configuration of the non-free-threaded build.Linked PRs
lib/python3.14t
#121293The text was updated successfully, but these errors were encountered: