cancel
Showing results for 
Search instead for 
Did you mean: 
Community Platform Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to install and use tkinter in databricks notebooks?

Abdurrahman
New Contributor II

I have access to databricks cloud UI. I use the notebooks for my experiments (not MLFlow).

I install libraries using the notebooks by using this command - !pip install LIBRARY_NAME

I am unable to install tkinter and use it in notebook as. Is there a way to install and use tkinter in the notebooks?

2 REPLIES 2

Kaniz_Fatma
Community Manager
Community Manager

Hi @Abdurrahman, To install and use Tkinter in Databricks Notebooks, follow these steps:

  1. Create a Library:

    • Click on the “Libraries” tab in the left-hand panel of the Databricks workspace.
    • Select “Create Library”.
    • Choose whether to install a library from PyPI, upload a library in .whl or .egg format, or upload a library from a Maven repository.
  2. Attach the Library to a Cluster:

    • After creating the library, select the “Clusters” tab in the left-hand panel.
    • Choose the cluster you want to attach the library to.
    • Click on the “Libraries” tab for that cluster.
    • Click “Attach Library” and select the library you want to attach.
  3. Load the Library in Your Code:

    • Once the library is attached to the cluster, you can load it using the “import” statement.
    • For example, if you installed the pandas library, add “import pandas” at the beginning of your code.

Remember that the cluster runtime must be less than 7.0 to install Tkinter1.

Now you’re all set to create interactive GUIs using Tkinter in your Databricks Notebooks! 🎨🐍

 

Abdurrahman
New Contributor II

Hi @Kaniz_Fatma Thanks for your response. I believe the "Create Library" is depreciated. Although there is a way to install libraries in the cluster configurations which I found and can try to install libraries through there. After using that, still tkinter doesn't work with databricks. I am attaching the screenshots for your reference.

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