-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
Drop the pyvenv script #69341
Comments
I propose that the pyvenv script be deprecated in Python 3.5 and removed in Python 3.8. The reason for this proposal is because it is non-obvious what version of Python a pyvenv command is tied to (heck, it isn't necessarily obvious that it's Python 3). There would be no loss in functionality since the exact same functionality is available through As pointed out in issue bpo-25152, virtualenv provides a -p flag to specify what version of Python should be used to create a virtual environment: https://virtualenv.pypa.io/en/latest/reference.html#virtualenv-command. The pyvenv script and venv package provide no such mechanism since it is included in the stdlib, which makes sense since improvements will be tied to the stdlib of the Python interpreter being used while virtualenv is a standalone project/app. Some may argue that worrying about this is unnecessary, but we are already ending up with OSs that come with multiple versions of Python pre-installed, let alone when people install their own versions of Python on top of the system installation. For instance, OS X Yosemite comes with Python 2.6 and 2.7, and then if you install the latest version of Python independently you end up with 3 installations. If they all happened to have a pyvenv script you wouldn't easily know which Python interpreter the pyvenv command was going to use for the virtual environment. Since the pyvenv script is just a script, the deprecation will be in the form of a message printed to sys.stderr in the Tools/scripts/pyvenv file mentioning that the deprecation and that people should switch to |
I'm sympathetic, given that in Debian/Ubuntu (and maybe other distros) where we have both Python 3.4 and 3.5, we have to install /usr/bin/pyvenv-3.4 and pyvenv-3.5, and then use symlinks to provide the default version. |
Due to debian policy decision neither pyenv nor python -m venv may work for you. While things are getting changed, it would be good if people running into Error: Command '['<directory>/bin/python3.4', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1 such as 'Your python may not be configured with ensure-pip' |
the ensurepip case is another issue, so if you want you can file a separate issue for it so it doesn't get lost. |
I have a patch which will at least improve the error message when |
python-dev did not seem to object to the idea. |
I would prefer to keep this script with the version referring to the version of python used (pyvenv-3.4, pyvenv-3.5, ...). |
Here is a patch that adds a message to stderr about the deprecation. |
New changeset 6ab285820db2 by Brett Cannon in branch 'default': |
I have a typo in my commit where I accidentally placed the file argument in str.format() instead of for print() (pointed out on GitHub). |
Did you fix the "exeutable" typo? |
Not yet. I will get to it no later than Friday (just a matter of either remembering to quickly fix it when I get home from work, bother setting up SSH keys at work, or simply doing it on Friday when I typically do all of my Python work). |
May I ask how difficult it is for any of the core developers to fix a known typo in a Python source file? |
Fixing a typo is trivial. If the typo affects several version the changeset needs to be merged on all the applicable branches before being pushed. |
New changeset 7a5f8418b4ab by Brett Cannon in branch 'default': |
Sorry for the delay on this; fell ill Friday and then had guests all weekend. |
There's a typo here in 'executable':
And this could now be: ! And since there is no .format() call, you can't accidentally pass it file=. |
Took Eric's advice in 8828d7847e92 as well as actually tested the results this time. :P |
|
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: