0

I am trying to write up some python code to automate some stuff, and would like to install some ruby gems during the execution.

I am reading up Invoke

I tried using cli api which documented here, and this is how I am trying to run it:

import invoke
invoke.cli.parse(*args, **kwargs)

but getting this error:

AttributeError: 'module' object has no attribute 'cli' 
James Lin
  • 25,028
  • 36
  • 133
  • 233
  • You can also use subprocess.call as described [here](http://docs.python.org/2/library/subprocess.html) – Amit Feb 03 '14 at 20:41

1 Answers1

1

invoke.cli is probably a submodule of invoke which doesn't get imported by default. Try:

import invoke.cli

Edit: As I suspected, taking a look at __init__.py and the package organization confirms my suspicions. cli is a submodule that you need to import explicitly.

mgilson
  • 300,191
  • 65
  • 633
  • 696