Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Documentation of sys.base_prefix is unclear when a virtual environment is created from another virtual environment #95469

Open
Labels
docsDocumentation in the Doc dir
@pfmoore

Description

@pfmoore

Documentation of the sys module

The documentation ofsys.base_prefix states that "base_prefix andbase_exec_prefix will remain pointing to the base Python installation (the one which the virtual environment was created from)"

In the case of creating one virtual environment from another:

python -m venv foo --without pipfoo/Scripts/python.exe -m venv bar --without-pip

sys.base_prefix inbar points to the system Python installation,not to foo. (Tested on Windows). I believe this behaviour is better, and I'm suspect that existing tools rely on it, but regardless of what is correct behaviour, the documentation should be more explicit about what the expected value ofsys.base_prefix is in a virtual environment created from another virtual environment.

Also, given that the behaviour is documented as being (at least in part) implemented insite.py, the behaviour when the-S flag ("don't import site") is supplied to Python should be documented as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp