How to run a different python version then the default one on databricks cluster
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2023 12:37 AM
Hi All,
I recently have a use case where i need to run something on the databricks cluster and the bare requirement is that python version shoulde be 3.8 and DBR version should be 11+. I am confused on how to handle this. Is there anyway in which we can define the python version or creating a virtual env?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2023 05:52 AM - edited 07-03-2023 05:53 AM
Hello @deficiant_codge ,
I think it's not possible to modify the python version from a cluster manually without touching the DBR.
Indeed each version of DBR is coming with a specific version of Python, Spark and Scala. (You can see for each runtime the information about the versions (spark, new features...) : https://learn.microsoft.com/en-us/azure/databricks/release-notes/runtime/releases ).
Only way to switch of version is too switch of Runtime.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2023 06:00 AM
Finally just found a possible trick, you can maybe use a Docker image as poet_RY specified in this post: https://community.databricks.com/t5/data-engineering/upgrade-python-version-in-cluster/m-p/5431
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2023 08:18 AM
Hey Brice,
Thanks for the response, but can you help me out on understanding how will i put this docker image on Databricks I am a very basic user and not much clear on that any blog or post will help,
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 07:29 AM
Hey,
To be honest I don't really know...
You can check this stack Overflow post, the last reply is explaining how to do it.
Moreover, there is this documentation from Databricks on the subject: https://docs.databricks.com/clusters/custom-containers.html

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2023 02:25 AM
Hope everything is going great.
Just wanted to check in if you were able to resolve your issue. If yes, would you be happy to mark an answer as best so that other members can find the solution more quickly? If not, please tell us so we can help you.
Cheers!

