Home  >  Article  >  Backend Development  >  How to import wmi in python

How to import wmi in python

silencement
silencementOriginal
2019-05-22 14:51:087172browse

Steps for python to import the wmi module: 1. Enter the command "pip install wmi" and press Enter; 2. Download the appropriate version of the wmi package from the official website and use the "pip install download file path/file name.whl" command Install the downloaded whl file; 3. Use the "import wmi" command to import it.

How to import wmi in python

WMI is the core of the Windows 2K/XP management system; for other Win32 operating systems, WMI is a useful plug-in.

WMI is based on CIMOM, which is the Common Information Model Object Manager.

is an object database that describes the components of the operating system and provides services for MMC and script programs. A public interface for accessing the building blocks of the operating system.

With WMI, tool software and script programs do not need to use different APIs to access different parts of the operating system;

On the contrary, different parts of the operating system can be plugged into WMI, as shown in the figure Display, tool software and WMI can easily read and write WMI.

I am very happy that there is wmi module in python. I just need to install pywin32 before installation, because wmi needs python to call the system win32api

How to import (install) the wmi module in python Method

Step 1:

pip install wmi

Step 1:

Go to the website https://pypi.org/project/pywin32/#files to download the appropriate version of the package ,

What I use here is:

pywin32-224-cp37-cp37m-win_amd64.whl (9.0 MB)

Step 3:

Use the command to install the downloaded whl file:

pip install pywin32-224-cp37-cp37m-win_amd64.whl

After completion, execute:

import wmi

No error is reported, indicating success

The above is the detailed content of How to import wmi in python. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn