New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
venv documentation doesn't tell you how to specify a particular version of python #69339
Comments
https://docs.python.org/3/library/venv.html nowhere explicitly states The doc says: "Creation of virtual environments is done by executing the pyvenv script:" which undoubtably works if you _have_ a pyenv script, but I don't have Fortunately, I can also run things as some_python_version -m venv myvenv This, everybody is able to do. (However, it may not work, see This is something that everybody ought to be able to do. Then, before the line: add the line: The version of python used in the venv is determined at this time. /path/to/the/python/I/want -m venv myenv instead. (Plus, if there is a way to do this with pyenv, then list that |
Our documentation describes what you get if you install Python using our distribution of python. If you do that, you (by default) get a pyvenv script, and it points to the version of python that you just (last) installed. Distributions change this. We can't document what every distribution does. That said, I think it would be a good idea to move the description of calling it via 'python -m venv' to be the *first* mention, and *then* describing pyvenv (and noting that it is installed by our installers but a vendor install may do something different, including omit it). |
On thinking things over, I think that venv is, as it stands now, If you want to build a virtualenv for python 2.7, then I think I think this needs to be mentioned. |
Not in the python3 docs, it doesn't. The python3 docs are documenting python3. But, this is another reason the -m venv description should be first, to make it clear it is *part* of the python version, not a standalone package that might work with multiple python versions. |
The problem is that people who run into venv will think that it is As Josh Billings (American humourist) wrote: A 'this is not virtualenv' message would be useful. |
Maybe we should consider dropping the generic pyvenv script or at least only install it with a full version suffix like pyvenv3.6 to prevent this kind of confusion (I have this issue all the time with pip and it drives me nuts). At the very minimum we should do as David suggests and bump up the |
I was surprised myself that pyvenv wasn't at least named pyvenv3. I think I've only ever used it once, mostly I use the -m because then I *know* what version of python I'm getting. I'd be in favor of dropping the script except that that would be a backward compatibility break. (Gentoo at least would probably recreate it so that 'pyvenv' continued to work no matter which version of python you had selected as your system default). |
It would break backwards-compatibility, but the fix is to simply switch to |
Actually, I like the idea of dropping pyvenv enough that I'm going to create an issue for it and bring it up on python-dev. |
bpo-25154 has deprecated pyvenv in 3.6. The docs, however, still need updating. The updated docs should mention pyvenv only to say that it is deprecated, I think. This change could be applied to 3.5 if we get it in before 3.5 final. |
New changeset 9feff7ba89b2 by Brett Cannon in branch '3.5': New changeset 126ff1f3b6cd by Brett Cannon in branch '3.6': New changeset 53bee4ef1d0a by Brett Cannon in branch 'default': |
http://buildbot.python.org/all/builders/Docs%203.x/builds/2710/steps/lint/logs/stdio |
I made a patch to address it. Please review. Thanks :) |
we can merge the patch of Mariatta |
Thanks, Stéphane :) |
It looks like Zachary beat me to fixing this: https://hg.python.org/cpython/rev/5d1934c27137. Thanks for the patch, Mariatta, even if Zachary didn't use it. |
Ah ha, I thought I'd seen it mentioned in an issue somewhere, but I didn't go looking when I noticed my Docs bots were all red. Thanks for the patch anyway, Mariatta! |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: