-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Closed
Closed
Copy link
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir
Description
Documentation
Documentation suggests sys.prefix
as an alternative to Py_GetPrefix
in the deprecation note here
Deprecated since version 3.13, will be removed in version 3.15: Get sys.prefix instead.
and it seems correct:
>>> import poc # CPython module that prints `Py_GetPrefix` on init
Prefix: /home/y5/micromamba/envs/py3.13
>>> import sys; print(sys.prefix); print(sys.base_prefix)
/home/y5/micromamba/envs/py3.13
/home/y5/micromamba/envs/py3.13
But strictly speaking, sys.base_prefix
is the real counterpart rather than sys.prefix
when it involves venv:
# inside venv
>>> import poc
Prefix: /home/y5/micromamba/envs/py3.13
>>> import sys; print(sys.prefix); print(sys.base_prefix)
/tmp/foo
/home/y5/micromamba/envs/py3.13
Source: #125235
Linked PRs
vstinner
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir