I am learning zeppelin. I have created two notebooks which have same setting (the default interpreter binding is python). My problem is that z.input() works well in one notebook but the other throws AttributeError:

I enter exactly code: print(z.input("greeting", "Hello World"))

Here is the detailed error: Traceback (most recent call last): File "/tmp/zeppelin_python-3719661631556809998.py", line 283, in raise Exception(traceback.format_exc()) Exception: Traceback (most recent call last): File "/tmp/zeppelin_python-3719661631556809998.py", line 276, in exec(code, _zcUserQueryNameSpace) File "", line 1, in AttributeError: 'str' object has no attribute 'input'

1 Answers

0
Community On

What version of Zeppelin are you using and can you post here your python interpreter session settings? Without further details I can only guess, that you have declared a string variable named 'z' in some other part of your zeppelin. It can be in a different paragraph in the same note that throws you an error. Eg.:

Paragraph #1:

%python
z = 'foo'

Paragraph #2:

%python
print(z.input("greeting", "Hello World"))

Running this note paragraph after paragraph will throw you the same error in paragraph #2. But with different zeppelin versions and python interpreter settings it may occur in other situations too.