Skip to content

Make venv follow links to a specific python version #2808

Open
@EdwinBennink

Description

@EdwinBennink

What's the problem this feature will solve?

When a venv is created using e.g. python3 -m venv myvenv, it will create the link myvenv/bin/python3 -> /usr/bin/python3 instead of myvenv/bin/python3.10 -> /usr/bin/python3.10.
When a new python version is installed, /usr/bin/python3 will (likely) link to the new version and so will the venv. This is not the desired behavior.

Describe the solution you'd like

Make venv follow links when creating the venv. The links in the bin dir should point to a specific version, e.g. myvenv/bin/python3.10 -> /usr/bin/python3.10, no matter if python was called using /usr/bin/python , /usr/bin/python3 or /usr/bin/python3.10 .

This enables installing other python versions without breaking existing virtual environments.

An alternative is to make users aware of the way this works and that they should be specific when creating the venv.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions