我正在与pyvmomi一起玩,并且设法使“示例”脚本(getallvms.py)工作。
我现在正在尝试在这里找到的其他脚本:https : //raw.githubusercontent.com/vmware/pyvmomi-community-samples/master/samples/vminfo_quick.py
当我运行此脚本时,出现以下错误:
Iwans-Mac:sample iwan-home-folder$ python vminfo_quick.py -s 10.11.11.215 -u [email protected] -p VMware1!
Traceback (most recent call last):
File "vminfo_quick.py", line 19, in <module>
from tools import cli
ImportError: No module named tools
我不确定如何安装模块“工具”。有人可以告诉我如何继续吗?
谢谢,伊万
您尝试运行的脚本旨在从示例项目目录中运行。为了获得最大的成功,您需要克隆项目:
git clone https://github.com/vmware/pyvmomi-community-samples
cd pyvmomi-community-samples/samples
python vminfo_quick.py xxxx
完成后,导入问题将消失。如果您在samples目录中查找,则会发现正在尝试导入的tools / cli。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句