Skip to content

How to Install PowerCLI 13 with Python 3.7 on Windows (Required for ImageBuilder)

With the release of PowerCLI 13, VMware has introduced some major enhancements. One of the most exciting features is that PowerCLI is now fully Multi-platform, which means that all functions are available for all PowerShell Core supported operating systems including Windows, macOS, and Linux. If you are planning to use the ImageBuilder module, you will need to have Python 3.7 installed on your machine.

If you want to use ImageBuilder-based commands in PowerCLI 13, you might see the following error:

Add-EsxSoftwareDepot: Could not initialize the VMware.ImageBuilder PowerCLI module. Make sure that Python 3.7 is installed and that you have set the path to the Python executable by using Set-PowerCLIConfiguration -PythonPath. See the PowerCLI Compatibility Matrixes for information on the Python requirements.

This article explains how to install and configure PowerCLI 13 with Python 3.7 to be ready to use ImageBuilder.

Step 1 - Install PowerCLI

The simplest way to install PowerCLI is by using the packages provides in Microsofts PowerShell Gallery: PowerShell Gallery | PowerCLI 13 

PS> Install-Module -Name VMware.PowerCLI

Step 2 - Install Python

Go to and download the executable installer. This will install python 3.7.9, which is currently the latest version where binaries are available.

You should note the path where Python is installed. If you did not note it during the installation wizard you can find it out later with the where command:

C:\> where python

Also, make sure that the python path is added to your PATH variables and you can run python from everywhere.

c:\> python --version
Python 3.7.9

Step 3 - Install PIP and Modules

PIP is Python's own packet manager which is required to install additional modules.

Download and run it with python.

c:\> python.exe .\
Collecting pip
Successfully installed pip-22.3.1

Now install modules six, psutil, lxml, and pyopenssl, which are required by PowerCLI.

c:\> pip3.7.exe install six psutil lxml pyopenssl

Step 4 - Open PowerShell and Configure PythonPath

If you've installed Python in your userspace you should be able to set PythonPath with the following command:

PS> Set-PowerCLIConfiguration -PythonPath $env:USERPROFILE\AppData\Local\Programs\Python\Python37\python.exe -Scope User

Now you should be able to use PowerCLI ImageBuilder.


Example to create ESXi 8 Image with the USB NIC Fling.

Add-EsxSoftwareDepot .\
Add-EsxSoftwareDepot .\
New-EsxImageProfile -CloneProfile "ESXi-8.0a-20842819-standard" -name "ESXi-8.0a-20842819-USBNIC" -Vendor ""
Add-EsxSoftwarePackage -ImageProfile "ESXi-8.0a-20842819-USBNIC" -SoftwarePackage "vmkusb-nic-fling"
Export-ESXImageProfile -ImageProfile "ESXi-8.0a-20842819-USBNIC" -ExportToIso -filepath ESXi-8.0a-USBNIC.iso
Export-ESXImageProfile -ImageProfile "ESXi-8.0a-20842819-USBNIC" -ExportToBundle -filepath

5 thoughts on “How to Install PowerCLI 13 with Python 3.7 on Windows (Required for ImageBuilder)”

  1. Can you give this a quick 2024 update? I'm dead in the water with either python3.7 or python3.12 in both macos and windows10. I get errors to check my pythonpath (yes, it's set...) and/or check my python version (see above for both tests....). Worth a quick rehash?

    I can't believe vmware makes it this difficult. It's excruciating.

  2. I had python issues as well. Then I realized I was running PS as an admin. I ran as the user I set the env path variables as and it worked

  3. I am getting the following when I try to run Add-EsxSoftwarePackage -ImageProfile "ESXi-8.0U1-21495797-USBNIC" -SoftwarePackage "vmkusb-nic-fling"

    requires vmkapi_2_12_0_0, but the requirement cannot be satisfied within the ImageProfile.

Leave a Reply

Your email address will not be published. Required fields are marked *