[GH-ISSUE #62] 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 #45

Closed
opened 2026-02-28 02:14:26 +03:00 by kerem · 7 comments
Owner

Originally created by @Jas0n0ss on GitHub (Feb 6, 2023).
Original GitHub issue: https://github.com/VFrontDe-Org/ESXi-Customizer-PS/issues/62

**********************
Windows PowerShell 脚本开始
开始时间: 20230206162532
PSVersion: 5.1.22621.963
PSEdition: Desktop
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.22621.963
BuildVersion: 10.0.22621.963
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1
**********************
          Welcome to VMware PowerCLI!

Log in to a vCenter Server or ESX host:
Connect-VIServer
To find out what commands are available, type:
Get-VICommand
To show searchable help for all PowerCLI commands:
Get-PowerCLIHelp
Once you've connected, display all virtual machines:
Get-VM
If you need more help, visit the PowerCLI community:
Get-PowerCLICommunity

       Copyright (C) VMware, Inc. All rights reserved.



Running with PowerShell version 5.1 and VMware PowerCLI version 13.0.0 build 20829139

Connecting the VMware ESXi Software depot ...
PS>TerminatingError(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.”


An unexpected error occurred:
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.

If requesting support please be sure to include the log file
   C:\Users\JASONH~1\AppData\Local\Temp\ESXi-Customizer-PS-8284.log

PS C:\Users\Jason Hu> C:\python\Python37\python.exe -V
Python 3.7.0
PS C:\Users\Jason Hu> Set-PowerCLIConfiguration -PythonPath 'C:\python\Python37\'
PS C:\Users\Jason Hu\Desktop\exsi\ESXi-Customizer-PS-2.9.0> .\ESXi-Customizer-PS.ps1 -v70 -vft -load sata-xahci,net-r8101,net-r8139too -nsc
---
An unexpected error occurred:
The PythonPath PowerCLI configuration 'C:\python\Python37\' points to a non-existing file. 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

when I use set env with Set-PowerCLIConfiguration -PythonPath 'C:\python\Python37\', it's still not working , any ideas?

Originally created by @Jas0n0ss on GitHub (Feb 6, 2023). Original GitHub issue: https://github.com/VFrontDe-Org/ESXi-Customizer-PS/issues/62 ``` ********************** Windows PowerShell 脚本开始 开始时间: 20230206162532 PSVersion: 5.1.22621.963 PSEdition: Desktop PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.22621.963 BuildVersion: 10.0.22621.963 CLRVersion: 4.0.30319.42000 WSManStackVersion: 3.0 PSRemotingProtocolVersion: 2.3 SerializationVersion: 1.1.0.1 ********************** Welcome to VMware PowerCLI! Log in to a vCenter Server or ESX host: Connect-VIServer To find out what commands are available, type: Get-VICommand To show searchable help for all PowerCLI commands: Get-PowerCLIHelp Once you've connected, display all virtual machines: Get-VM If you need more help, visit the PowerCLI community: Get-PowerCLICommunity Copyright (C) VMware, Inc. All rights reserved. Running with PowerShell version 5.1 and VMware PowerCLI version 13.0.0 build 20829139 Connecting the VMware ESXi Software depot ... PS>TerminatingError(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.” An unexpected error occurred: 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. If requesting support please be sure to include the log file C:\Users\JASONH~1\AppData\Local\Temp\ESXi-Customizer-PS-8284.log ``` ``` PS C:\Users\Jason Hu> C:\python\Python37\python.exe -V Python 3.7.0 PS C:\Users\Jason Hu> Set-PowerCLIConfiguration -PythonPath 'C:\python\Python37\' ``` ``` PS C:\Users\Jason Hu\Desktop\exsi\ESXi-Customizer-PS-2.9.0> .\ESXi-Customizer-PS.ps1 -v70 -vft -load sata-xahci,net-r8101,net-r8139too -nsc --- An unexpected error occurred: The PythonPath PowerCLI configuration 'C:\python\Python37\' points to a non-existing file. 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 ``` when I use set env with `Set-PowerCLIConfiguration -PythonPath 'C:\python\Python37\'`, it's still not working , any ideas?
kerem closed this issue 2026-02-28 02:14:26 +03:00
Author
Owner

@mrpressIdent commented on GitHub (Feb 6, 2023):

Set the path on Windows.

Set-PowerCLIConfiguration -PythonPath <python3.7-directory>\python.exe -Scope User

If you want to use ESXi8 you should use python 3.7.9

<!-- gh-comment-id:1418807204 --> @mrpressIdent commented on GitHub (Feb 6, 2023): Set the path on Windows. Set-PowerCLIConfiguration -PythonPath <python3.7-directory>\python.exe -Scope User If you want to use ESXi8 you should use python 3.7.9
Author
Owner

@mithril52 commented on GitHub (Feb 6, 2023):

I am having the same issue, and the above did not fix it. I have even tried installing 3.7.9, still get the same error

<!-- gh-comment-id:1419161489 --> @mithril52 commented on GitHub (Feb 6, 2023): I am having the same issue, and the above did not fix it. I have even tried installing 3.7.9, still get the same error
Author
Owner

@mrpressIdent commented on GitHub (Feb 6, 2023):

You are sure that you have specified the correct path (incl. phyton.exe) completely? If yes, then restart Powershell once

<!-- gh-comment-id:1419179003 --> @mrpressIdent commented on GitHub (Feb 6, 2023): You are sure that you have specified the correct path (incl. phyton.exe) completely? If yes, then restart Powershell once
Author
Owner

@mithril52 commented on GitHub (Feb 6, 2023):

Yes. And have restarted powershell multiple times

PS C:\Users\baene\Downloads> C:\Users\baene\AppData\Local\Programs\Python\Python37\python.exe -V
Python 3.7.9
PS C:\Users\baene\Downloads> Set-PowerCLIConfiguration -PythonPath "C:\Users\baene\AppData\Local\Programs\Python\Python37\python.exe" -Scope User

Perform operation?
Performing operation 'Update VMware.PowerCLI configuration.'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y

Scope ProxyPolicy DefaultVIServerMode InvalidCertificateAction DisplayDeprecationWarnings WebOperationTimeout
Seconds


Session UseSystemProxy Multiple Unset True 300
User
AllUsers

<!-- gh-comment-id:1419204968 --> @mithril52 commented on GitHub (Feb 6, 2023): Yes. And have restarted powershell multiple times PS C:\Users\baene\Downloads> C:\Users\baene\AppData\Local\Programs\Python\Python37\python.exe -V Python 3.7.9 PS C:\Users\baene\Downloads> Set-PowerCLIConfiguration -PythonPath "C:\Users\baene\AppData\Local\Programs\Python\Python37\python.exe" -Scope User Perform operation? Performing operation 'Update VMware.PowerCLI configuration.'? [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y Scope ProxyPolicy DefaultVIServerMode InvalidCertificateAction DisplayDeprecationWarnings WebOperationTimeout Seconds ----- ----------- ------------------- ------------------------ -------------------------- ------------------- Session UseSystemProxy Multiple Unset True 300 User AllUsers
Author
Owner

@mithril52 commented on GitHub (Feb 6, 2023):

Figured out the issue. I did not have pip and the additional packages installed that PowerCLI uses when the ImageBuilder module is used:

https://developer.vmware.com/docs/15315//GUID-9081EBAF-BF85-48B1-82A0-D1C49F3FF1E8.html

<!-- gh-comment-id:1419507331 --> @mithril52 commented on GitHub (Feb 6, 2023): Figured out the issue. I did not have pip and the additional packages installed that PowerCLI uses when the ImageBuilder module is used: https://developer.vmware.com/docs/15315//GUID-9081EBAF-BF85-48B1-82A0-D1C49F3FF1E8.html
Author
Owner

@virtualex-itv commented on GitHub (Feb 8, 2023):

Figured out the issue. I did not have pip and the additional packages installed that PowerCLI uses when the ImageBuilder module is used:

developer.vmware.com/docs/15315//GUID-9081EBAF-BF85-48B1-82A0-D1C49F3FF1E8.html

@Jas0n0ss - closing this issue with the answer noted above. not an issue with the script but rather not meeting the new requirements to enable the module.

<!-- gh-comment-id:1423155979 --> @virtualex-itv commented on GitHub (Feb 8, 2023): > Figured out the issue. I did not have pip and the additional packages installed that PowerCLI uses when the ImageBuilder module is used: > > [developer.vmware.com/docs/15315//GUID-9081EBAF-BF85-48B1-82A0-D1C49F3FF1E8.html](https://developer.vmware.com/docs/15315//GUID-9081EBAF-BF85-48B1-82A0-D1C49F3FF1E8.html) @Jas0n0ss - closing this issue with the answer noted above. not an issue with the script but rather not meeting the new requirements to enable the module.
Author
Owner

@Jas0n0ss commented on GitHub (Feb 11, 2023):

https://oss.msft.vip/2023/02/10/custom-exsi-iso-with-Additional-driver/

<!-- gh-comment-id:1426700516 --> @Jas0n0ss commented on GitHub (Feb 11, 2023): https://oss.msft.vip/2023/02/10/custom-exsi-iso-with-Additional-driver/
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ESXi-Customizer-PS#45
No description provided.