You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
venv module doesn't create a copy of python binary by default #79631
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2018-12-15.13:49:17.178>created_at=<Date2018-12-09.18:05:37.447>labels= ['3.7', '3.8', 'docs']
title="venv module doesn't create a copy of python binary by default"updated_at=<Date2018-12-15.13:49:17.176>user='https://github.com/mkkot'
Running this command creates the target directory (creating any parent directories that don’t exist already) and places a pyvenv.cfg file in it with a home key pointing to the Python installation from which the command was run. It also creates a bin (or Scripts on Windows) subdirectory containing **a copy** of the python binary (or binaries, in the case of Windows)."
This is not true. In my case it creates symlinks to python binary by default. This is quite different. Upgrading system's python version broke my virtual environment because I believed I'm having a static copy of python binary in my virtual environment.
Correct, that should say something like "copy/symlink of the Python binary/binaries (as appropriate by the platform or arguments used at environment creation time)."
New changeset f5107df by Miss Islington (bot) (mkkot) in branch 'master': bpo-35450: reflect in docs that venv module is not always creating a … (GH-11144) f5107df
New changeset 1fb312c by Brett Cannon (Miss Islington (bot)) in branch '3.6': bpo-35450: reflect in docs that venv module is not always creating a copy of the Python binary (GH-11144) (GH-11168) 1fb312c
New changeset d5176fe by Brett Cannon (Miss Islington (bot)) in branch '3.7': bpo-35450: reflect in docs that venv module is not always creating a copy of the Python binary (GH-11144) (GH-11167) d5176fe
Activity
mkkot commentedon Dec 9, 2018
Hello,
from documentation:
https://docs.python.org/3/library/venv.html
"python3 -m venv /path/to/new/virtual/environment
Running this command creates the target directory (creating any parent directories that don’t exist already) and places a pyvenv.cfg file in it with a home key pointing to the Python installation from which the command was run. It also creates a bin (or Scripts on Windows) subdirectory containing **a copy** of the python binary (or binaries, in the case of Windows)."
This is not true. In my case it creates symlinks to python binary by default. This is quite different. Upgrading system's python version broke my virtual environment because I believed I'm having a static copy of python binary in my virtual environment.
brettcannon commentedon Dec 11, 2018
Correct, that should say something like "copy/symlink of the Python binary/binaries (as appropriate by the platform or arguments used at environment creation time)."
brettcannon commentedon Dec 11, 2018
Obviously if you're willing to create a PR, Marcin, that would be great!
mkkot commentedon Dec 13, 2018
I'm very honoured with your request. Doing this for the first time with Python, hope you can accept it despite warnings.
#11144
miss-islington commentedon Dec 14, 2018
New changeset f5107df by Miss Islington (bot) (mkkot) in branch 'master':
bpo-35450: reflect in docs that venv module is not always creating a … (GH-11144)
f5107df
brettcannon commentedon Dec 14, 2018
New changeset 1fb312c by Brett Cannon (Miss Islington (bot)) in branch '3.6':
bpo-35450: reflect in docs that venv module is not always creating a copy of the Python binary (GH-11144) (GH-11168)
1fb312c
brettcannon commentedon Dec 14, 2018
New changeset d5176fe by Brett Cannon (Miss Islington (bot)) in branch '3.7':
bpo-35450: reflect in docs that venv module is not always creating a copy of the Python binary (GH-11144) (GH-11167)
d5176fe
terryjreedy commentedon Dec 14, 2018
Close this?
mkkot commentedon Dec 14, 2018
Actually the documentation hasn't been regenerated yet. I hope it will over night?
csabella commentedon Dec 15, 2018
It looks like the documentation has regenerated. Thanks!