Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while importing pyVim.connect

I am attempting to run the following code which I received from samples here

from __future__ import print_function
import atexit
from pyVim.connect import SmartConnectNoSSL, Disconnect
from pyVmomi import vim
from tools import cli

I am receiving the following error:

ModuleNotFoundError: No Module named 'pyVim.connect'

The packages in question are from here and were installed using:

pip install pyvmomi

Is there something wrong with how I am installing these packages?

like image 416
Trevor Jordy Avatar asked Dec 23 '22 05:12

Trevor Jordy


2 Answers

Looks like the code was a bit old. Importing 'pyvim' instead of 'pyVim' worked, though it seems to be named 'pyVim' on the github.

like image 123
Trevor Jordy Avatar answered Dec 25 '22 18:12

Trevor Jordy


It's possible that you need to reinstall pvmomi to force the re-install of additional files in the pyVim/ package dir:

pip3 install --force pyvmomi
like image 21
Brian Cunnie Avatar answered Dec 25 '22 18:12

Brian Cunnie