{"id":24179,"library":"os-win","title":"os-win","description":"Windows / Hyper-V library for OpenStack projects. Provides modules for managing Hyper-V virtual machines, storage, networking, and other Windows Server features. Current version 5.9.0 (requires Python >= 3.6). Released as needed for OpenStack releases.","status":"active","version":"5.9.0","language":"python","source_language":"en","source_url":"https://opendev.org/openstack/os-win","tags":["openstack","windows","hyper-v","virtualization"],"install":[{"cmd":"pip install os-win","lang":"bash","label":"Install from PyPI"},{"cmd":"pip install os-win[hyperv]","lang":"bash","label":"Install with Hyper-V extra dependencies"}],"dependencies":[{"reason":"Common dependency for OpenStack projects, often missing","package":"oslo.concurrency","optional":true}],"imports":[{"note":"HyperVUtils is a class within a module; use utilsfactory.HyperVUtils()","wrong":"from os_win import HyperVUtils","symbol":"HyperVUtils","correct":"from os_win import utilsfactory"},{"note":"vmutils is a submodule under os_win.utils","wrong":"from os_win import vmutils","symbol":"VMUtils","correct":"from os_win.utils import vmutils"},{"note":"Correct module path includes 'utils' package","wrong":"from os_win import hostutils","symbol":"HostUtils","correct":"from os_win.utils import hostutils"}],"quickstart":{"code":"from os_win import utilsfactory\n\n# Initialize utils using the factory\nutils = utilsfactory.HyperVUtils()\nprint(utils.get_host_info())\nprint(utils.list_instances())","lang":"python","description":"Basic usage: create a factory instance and call common methods (requires admin privileges on Windows)."},"warnings":[{"fix":"Use conditional imports or run only on Windows.","message":"os-win is Windows-only. Importing or using on Linux/macOS will raise ImportError or silently fail.","severity":"gotcha","affected_versions":"all"},{"fix":"Run Python with 'Run as administrator' or ensure the user is in the Hyper-V Administrators group.","message":"Most methods require administrator privileges on Windows. Running without elevated rights will raise exceptions.","severity":"gotcha","affected_versions":"all"},{"fix":"Use the official public API: from os_win import utilsfactory or from os_win.utils import *","message":"The old import path 'from os_win import _utils' is deprecated and may be removed in future versions.","severity":"deprecated","affected_versions":">=5.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Import using 'import os_win' (note the underscore).","cause":"Misspelled package name: the PyPI name is 'os-win' but the import is 'os_win' (underscore instead of hyphen).","error":"ModuleNotFoundError: No module named 'os_win'"},{"fix":"Use 'from os_win import utilsfactory' and then utilsfactory.HyperVUtils().","cause":"HyperVUtils is not a direct top-level module; it is located under os_win.utilsfactory.","error":"ImportError: cannot import name 'HyperVUtils' from 'os_win'"},{"fix":"Run Python as Administrator or ensure the user has necessary privileges.","cause":"Insufficient permissions. Hyper-V management requires administrator rights.","error":"OSError: [WinError 5] Access is denied"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}