Title: Free-threaded libraries should be in `lib/python3.14t` (configure) · Issue #121103 · python/cpython · GitHub
Open Graph Title: Free-threaded libraries should be in `lib/python3.14t` (configure) · Issue #121103 · python/cpython
X Title: Free-threaded libraries should be in `lib/python3.14t` (configure) · Issue #121103 · python/cpython
Description: 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 same lib directory. For example, when installing Python 3.14 the str...
Open Graph Description: 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 same lib directory. For exam...
X Description: 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 same lib directory. For exam...
Opengraph URL: https://github.com/python/cpython/issues/121103
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Free-threaded libraries should be in `lib/python3.14t` (configure)","articleBody":"# Bug report\n\n### Background\n\nWhen using `configure` based Python installations, if two the free-threaded and default builds are installed to the same prefix, they will share the same `lib` directory. For example, when installing Python 3.14 the structure looks like:\n\n```\ninclude/python3.14/...\ninclude/python3.14t/...\nlib/libpython3.14.a\nlib/libpython3.14t.a\nlib/python3.14/... # shared!\n```\n\nThe include directories are *not* shared, which is good because they have different `pyconfig.h` files.\n\nHowever, 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.\n\nFor example, if I run:\n\n* `python3.14 -m pip install numpy` (install in default build)\n* `python3.14t -c \"import numpy\"`\n\nI get a confusing error message:\n\n\u003cdetails>\n\u003csummary>Error importing numpy: you should not try to import numpy from its source directory...\u003c/summary>\n\n```\nTraceback (most recent call last):\n File \"/tmp/python-nogil/lib/python3.14/site-packages/numpy/_core/__init__.py\", line 23, in \u003cmodule>\n from . import multiarray\n File \"/tmp/python-nogil/lib/python3.14/site-packages/numpy/_core/multiarray.py\", line 10, in \u003cmodule>\n from . import overrides\n File \"/tmp/python-nogil/lib/python3.14/site-packages/numpy/_core/overrides.py\", line 8, in \u003cmodule>\n from numpy._core._multiarray_umath import (\n add_docstring, _get_implementing_args, _ArrayFunctionDispatcher)\nModuleNotFoundError: No module named 'numpy._core._multiarray_umath'\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/tmp/python-nogil/lib/python3.14/site-packages/numpy/__init__.py\", line 114, in \u003cmodule>\n from numpy.__config__ import show as show_config\n File \"/tmp/python-nogil/lib/python3.14/site-packages/numpy/__config__.py\", line 4, in \u003cmodule>\n from numpy._core._multiarray_umath import (\n ...\u003c3 lines>...\n )\n File \"/tmp/python-nogil/lib/python3.14/site-packages/numpy/_core/__init__.py\", line 49, in \u003cmodule>\n raise ImportError(msg)\nImportError: \n\nIMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!\n\nImporting the numpy C-extensions failed. This error can happen for\nmany reasons, often due to issues with your setup or how NumPy was\ninstalled.\n\nWe have compiled some common reasons and troubleshooting tips at:\n\n https://numpy.org/devdocs/user/troubleshooting-importerror.html\n\nPlease note and check the following:\n\n * The Python version is: Python3.14 from \"/tmp/python-nogil/bin/python3.14t\"\n * The NumPy version is: \"2.0.0\"\n\nand make sure that they are the versions you expect.\nPlease carefully study the documentation linked above for further help.\n\nOriginal error was: No module named 'numpy._core._multiarray_umath'\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"\u003cstring>\", line 1, in \u003cmodule>\n import numpy\n File \"/tmp/python-nogil/lib/python3.14/site-packages/numpy/__init__.py\", line 119, in \u003cmodule>\n raise ImportError(msg) from e\nImportError: Error importing numpy: you should not try to import numpy from\n its source directory; please exit the numpy source tree, and relaunch\n your python interpreter from there.\n```\n\u003c/details>\n\nIt would be better if installing NumPy in the default build did not make it available in the free-threaded build and vice versa.\n\n### Proposal\n\nWe should add the ABI suffix to the lib directory, like we do for the include directory. Specifically, we should use `python$(LDVERSION)` instead of `python$(VERSION)`.For example, the free-threaded build would use `lib/python3.14t` in Python 3.14.\n\nDebug 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.\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-121293\n* gh-121631\n* gh-122737\n* gh-122750\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/colesbury","@type":"Person","name":"colesbury"},"datePublished":"2024-06-27T17:53:14Z","url":"https://github.com/python/cpython/issues/121103"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9dab4c6a-13f4-7661-54eb-a17a9b4c5c2f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DE4A:4279A:330F039:44A8DFC:6B0210EF |
| html-safe-nonce | aa0730e9449b860bd1e38b3b93cdfaf2a4b0a79505cfe067049bbe0491aa88cb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTRBOjQyNzlBOjMzMEYwMzk6NDRBOERGQzo2QjAyMTBFRiIsInZpc2l0b3JfaWQiOiI1MDM3MDExNTg0OTU4OTkyNjIzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 264ea591f4c09ff9dd586d99932bcb16f83356751810c58a1a72f77998d3c29c |
| hovercard-subject-tag | issue:2378752160 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/121103/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2a35263d6675514fcc6d8b33c952d4efd984240137539d5f4c64301b21298876/python/cpython/issues/121103 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2a35263d6675514fcc6d8b33c952d4efd984240137539d5f4c64301b21298876/python/cpython/issues/121103 |
| og:image:alt | 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 same lib directory. For exam... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | colesbury |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width