@@ -18,14 +18,29 @@ To achieve this, it will first check if it's currently running inside a virtual
18
18
If it is, it will use it directly without creating a new one. But if it's not, it will use
19
19
one that it has already created or create a brand new one for you.
20
20
21
- By default, Poetry will try to use the currently activated Python version
21
+ By default, Poetry will try to use the Python version used during Poetry's installation
22
22
to create the virtual environment for the current project.
23
23
24
24
However, for various reasons, this Python version might not be compatible
25
25
with the ` python ` requirement of the project. In this case, Poetry will try
26
26
to find one that is and use it. If it's unable to do so then you will be prompted
27
27
to activate one explicitly, see [ Switching environments] ( #switching-between-environments ) .
28
28
29
+ {{% note %}}
30
+ To easily switch between Python versions, it is recommended to
31
+ use [ pyenv] ( https://github.com/pyenv/pyenv ) or similar tools.
32
+
33
+ For instance, if your project requires a newer Python than is available with
34
+ your system, a standard workflow would be:
35
+
36
+ ``` bash
37
+ pyenv install 3.9.8
38
+ pyenv local 3.9.8 # Activate Python 3.9 for the current project
39
+ poetry install
40
+ ```
41
+ This requires setting the ` virtualenvs.prefer-shell-python ` option to ` true ` .
42
+ {{% /note %}}
43
+
29
44
## Switching between environments
30
45
31
46
Sometimes this might not be feasible for your system, especially Windows where ` pyenv `
0 commit comments