install_utils#
Utilities module with minimal dependencies (standard library only) for installation
- class CondaPackage(line: str)[source]#
Bases:
object- property comment#
- property name#
- split_pattern = re.compile('^(?P<name>[\\w\\.\\-]+)(?P<version>[\\s=><,]+[\\d\\.\\*]+)?(?:\\s*(?P<comment>\\#.*))?$')#
- property version#
- class EnvFileManager(cfg_path, dest_path)[source]#
Bases:
object- patch_environment_package_line(package_name, pkg_version='', comparison_operator='=')[source]#
Patch the yaml environment file
- Parameters:
package_name
pkg_version
Returns
- property python_version#
- class PytorchVersionManager(cfg_path, python_version, pytorch_version='1.11')[source]#
Bases:
object- property cuda_major#
- property cuda_version#
- property pytorch_info#
- patch_env(cfg_path, dest_path, use_cuda_torch=True, pip_mode=False, use_spyder=False, tmp_dir=None)[source]#
Patch the environment file to match the desired configuration. This is mostly to get a working pytorch installation with the correct cuda version.
- Parameters:
cfg_path
dest_path (str) – If evaluates to False, the cfg_path is overwritten
use_cuda_torch (bool) – If True, install pytorch with cuda support
pip_mode (bool) – If True, install pytorch with pip (since the nvidia channel is now considered a paid channel)
use_spyder
tmp_dir
Returns