Python: Difference between revisions
imported>Samuela No edit summary |
imported>Samuela No edit summary |
||
| Line 31: | Line 31: | ||
The Python 3 venv approach has the benefit of forcing you to choose a specific version of the Python 3 interpreter that should be used to create the virtual environment. This avoids any confusion as to which Python installation the new environment is based on. | The Python 3 venv approach has the benefit of forcing you to choose a specific version of the Python 3 interpreter that should be used to create the virtual environment. This avoids any confusion as to which Python installation the new environment is based on. | ||
Recommended usage: | |||
* Python 3.3-3.4 (old): the recommended way to create a virtual environment was to use the pyvenv command-line tool that also comes included with your Python 3 installation by default. | |||
* Python 3.6+: <code>python3 -m venv</code> is the way to go. | |||
Put your packages in a requirements.txt: | Put your packages in a requirements.txt: | ||