cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Import Py File

clentin
Contributor

How do i import a .py file in Databricks environment?

Any help will be appreciated.

 

clentin
5 REPLIES 5

tejaswi24
New Contributor III

Hi @clentin , did you get an answer to this. Im looking for a similar thing. The api only imports .py as notebooks. I want them to be deployed as file type in workspace

filipniziol
Contributor

Hi @clentin ,

The steps:

1. Create your .py to be imported as a file and not a notebook
2. In the notebook that uses your .py file append its path to sys.path

Check my answer to the similar question for more details:
https://community.databricks.com/t5/data-engineering/trying-to-use-python-source-file-as-module-in-d...

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