Error while importing pyVim.connect

寵の児 提交于 2020-01-24 13:58:21

问题


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?


回答1:


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




回答2:


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


来源:https://stackoverflow.com/questions/51732582/error-while-importing-pyvim-connect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!