If you have multiple automation projects that invoke Python scripts, you may eventually run into a situation where you would need to use different versions of the same Python libraries across different projects, but would need to share a common production environment.
If you have a system-wide installation of Python libraries, this might cause the bots to break in production.
Using venv you can create lightweight “virtual environments” which provide the ability to have project-specific dependencies installed in a virtual environment, instead of forcing you to install your packages system-wide.
The Package Contains 2 activities.
Create venv: This activity is used to create a new Python venv.
The activity returns a PyVenv object which has the below attributes:
VenvPath: Full path of the venv.
VenvPyExecutable: Full path of the python.exe file located within the venv.
VenvScriptsPath: Full path of the Scripts folder within the venv.
2. Deactivate venv: This activity is used to deactivate and delete the venv.