Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

from tools import tasks, ImportError: cannot import name tasks

Tags:

python

pyvmomi

Trying to execute this sample code as I need to create a vm using pyvmomi. But the execution fails at the start in from tools import tasks with the error: ImportError: cannot import name tasks.

I have tried for long but could not resolve the error. I have python 2.7 on centOS 6.4

tools module is installed but do not have tasks.py inside /usr/local/lib/python2.7/site-packages/tools/

Not sure which tools packages have to be installed. Please guide.

like image 212
pythonuser Avatar asked Dec 07 '25 21:12

pythonuser


1 Answers

The module you want is this one https://github.com/vmware/pyvmomi-community-samples/tree/master/samples/tools not the module you obtain installing it through pip.

It's a sample module that's why maybe you got confused. In the link you provided probably they are using this sample module.

like image 200
lapinkoira Avatar answered Dec 09 '25 13:12

lapinkoira



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!