of the mailing list used to coordinate Python packaging standards
development).
-.. deprecated:: 3.6
- ``pyvenv`` was the recommended tool for creating virtual environments for
- Python 3.3 and 3.4, and is `deprecated in Python 3.6
- <https://docs.python.org/dev/whatsnew/3.6.html#deprecated-features>`_.
-
.. versionchanged:: 3.5
The use of ``venv`` is now recommended for creating virtual environments.
See :pep:`405` for more information about Python virtual environments.
-.. note::
- The ``pyvenv`` script has been deprecated as of Python 3.6 in favor of using
- ``python3 -m venv`` to help prevent any potential confusion as to which
- Python interpreter a virtual environment will be based on.
Creating virtual environments
Removed
=======
+* The ``pyvenv`` script has been removed in favor of ``python3.8 -m venv``
+ to help eliminate confusion as to what Python interpreter the ``pyvenv``
+ script is tied to. (Contributed by Brett Cannon in :issue:`25427`.)
Porting to Python 3.8
pydoc3 \
python3 \
python3-config \
- pyvenv \
; \
do \
rm -f $${fn} ; \
pydoc$(VERSION) \
python$(VERSION) \
python$(LDVERSION)-config \
- pyvenv-$(VERSION) \
; \
do \
rm -f $${fn} ;\
(cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3)
-rm -f $(DESTDIR)$(BINDIR)/2to3
(cd $(DESTDIR)$(BINDIR); $(LN) -s 2to3-$(VERSION) 2to3)
- -rm -f $(DESTDIR)$(BINDIR)/pyvenv
- (cd $(DESTDIR)$(BINDIR); $(LN) -s pyvenv-$(VERSION) pyvenv)
if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \
rm -f $(DESTDIR)$(BINDIR)/python3-32$(EXE); \
(cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-32$(EXE) python3-32$(EXE)) \
--- /dev/null
+Remove the pyvenv script in favor of ``python3 -m venv`` in order to lower
+confusion as to what Python interpreter a virtual environment will be
+created for.
<Component Id="Tools_scripts_pydoc3.py" Directory="Tools_scripts" Guid="*">
<File Id="Tools_scripts_pydoc3.py" Name="pydoc3.py" Source="!(bindpath.src)Tools\scripts\pydoc3" />
</Component>
- <Component Id="Tools_scripts_pyvenv.py" Directory="Tools_scripts" Guid="*">
- <File Id="Tools_scripts_pyvenv.py" Name="pyvenv.py" Source="!(bindpath.src)Tools\scripts\pyvenv" />
- </Component>
</ComponentGroup>
</Fragment>
<Fragment>
+++ /dev/null
-#!/usr/bin/env python3
-if __name__ == '__main__':
- import sys
- import pathlib
-
- executable = pathlib.Path(sys.executable or 'python3').name
- print('WARNING: the pyenv script is deprecated in favour of '
- f'`{executable} -m venv`', file=sys.stderr)
-
- rc = 1
- try:
- import venv
- venv.main()
- rc = 0
- except Exception as e:
- print('Error: %s' % e, file=sys.stderr)
- sys.exit(rc)
newoutfiles = []
newupdated_files = []
for filename in outfiles:
- if filename.endswith(('2to3', 'pyvenv')):
+ if filename.endswith('2to3'):
newfilename = filename + fullversion
else:
newfilename = filename + minoronly
# check the PyBuildScripts command above, and change the links
# created by the bininstall target in Makefile.pre.in
scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3",
- "Tools/scripts/2to3", "Tools/scripts/pyvenv"]
+ "Tools/scripts/2to3"]
)
# --install-platlib