Support Questions

Find answers, ask questions, and share your expertise

CM API Error python

New Contributor

I'm trying to setup a Cloudera Manager API. I use the following line for a test:

from cm_api.api_client import ApiResource

However, when I run this, I get the following:
Traceback (most recent call last):
File "[omitted]", line 1, in <module>
from cm_api.api_client import ApiResource
File "[omitted]", line 23, in <module>
from cm_api.http_client import HttpClient, RestException
File "[omitted]", line 186
except TypeError, tex:
                           ^
SyntaxError: invalid syntax

 

What is this error being caused by?

1 REPLY 1

New Contributor

Hi All,

 

I need to install cm_api.api_client import ApiResource . Pls suggest exact way .

I have installed api_clinet only as of now . Facing issue while checking modules name .

 

>>> import from cm_api.api_client import ApiResource
File "<stdin>", line 1
import from cm_api.api_client import ApiResource
^
SyntaxError: invalid syntax
>>>

 

Please suggest . Which module we need to install ?