realtwin.util_lib.venv_create

realtwin.util_lib.venv_create(*, venv_name: str = '', venv_dir: str = '', pkg_name: str = 'realtwin', verbose: bool = True) bool[source]

Create a virtual environment in the specified folder with the specified name.

Parameters:
  • venv_name (str) – the name of the virtual environment

  • venv_dir (str) – the path to the folder where the virtual environment will be created

  • pkg_name (str) – the name of the package to be installed in the virtual environment

  • verbose (bool) – whether to print the progress

Example

>>> import realtwin as rt
>>> rt.venv_create(venv_name="my_venv", venv_dir="/path/to/dir")
Raises:

Exception – if env_name is not a string, or folder_path is not a string

Returns:

True if the virtual environment is created successfully, False otherwise

Return type:

bool