cancel
Showing results for 
Search instead for 
Did you mean: 
missing-QuestionPost
cancel
Showing results for 
Search instead for 
Did you mean: 

A simple Python command on Databricks selection = input("Enter value") doesn't create a window box to enter the value. Searching reasons on the User Interface or other?

chico
New Contributor II
 
3 REPLIES 3

User16539034020
Databricks Employee
Databricks Employee

Hi, Chico:

In Databricks notebooks, input() function calls won't work as you might expect from running Python in other environments. Because Databricks notebooks are using Spark. They're not intended to interact with users in real-time, such as taking keyboard inputs.

There is alternative way: Databricks has a feature called "widgets". Widgets are interactive HTML forms that can be embedded within Databricks notebooks. Here is the example:

dbutils.widgets.text("inputs", '{"name":"Monica, "company":"Databricks"}')
inputs = dbutils.widgets.get("inputs")

Reference doc: https://docs.databricks.com/dev-tools/databricks-utils.html

Hello

I should nave clarified: this a Pyspark environnment not just a Python one.

The issue relies in the cluster settings as taking an other one provides the expected outcome. What is sspecific in my initial cluter SFC ?

Thanks

Anonymous
Not applicable

Hi @stephane cochetโ€‹ 

Thank you for posting your question in our community! We are happy to assist you.

To help us provide you with the most accurate information, could you please take a moment to review the responses and select the one that best answers your question?

This will also help other community members who may have similar questions in the future. Thank you for your participation and let us know if you need any further assistance! 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group