mirror of
https://github.com/python/cpython.git
synced 2025-10-03 13:45:29 +00:00
[3.11] gh-88452: Add a warning about non-portability of environments. (GH-98155) (GH-98157)
This commit is contained in:
parent
e0260d03f7
commit
e69136baff
1 changed files with 13 additions and 0 deletions
|
@ -85,6 +85,19 @@ Creating virtual environments
|
||||||
without there needing to be any reference to its virtual environment in
|
without there needing to be any reference to its virtual environment in
|
||||||
``PATH``.
|
``PATH``.
|
||||||
|
|
||||||
|
.. warning:: Because scripts installed in environments should not expect the
|
||||||
|
environment to be activated, their shebang lines contain the absolute paths
|
||||||
|
to their environment's interpreters. Because of this, environments are
|
||||||
|
inherently non-portable, in the general case. You should always have a
|
||||||
|
simple means of recreating an environment (for example, if you have a
|
||||||
|
requirements file ``requirements.txt``, you can invoke ``pip install -r
|
||||||
|
requirements.txt`` using the environment's ``pip`` to install all of the
|
||||||
|
packages needed by the environment). If for any reason you need to move the
|
||||||
|
environment to a new location, you should recreate it at the desired
|
||||||
|
location and delete the one at the old location. If you move an environment
|
||||||
|
because you moved a parent directory of it, you should recreate the
|
||||||
|
environment in its new location. Otherwise, software installed into the
|
||||||
|
environment may not work as expected.
|
||||||
|
|
||||||
.. _venv-api:
|
.. _venv-api:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue