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:ย 

How to deploy a python script with dependencies by dbx?

dslin
New Contributor III

Hi,

I'm quite new here. I'm trying to perform a deployment of python file with dbx command. The file contains libraries to be installed. How may I deploy the file (together with its dependencies) to databricks?

Here are the commands I currently run:

`dbx deploy --job=Sample-Training-Job-File --no-rebuild`

`dbx launch --job=Sample-Training-Job-File --trace`

And my `Sample-Training-Job-File` is specified in the `depployment.yml` as follows. This is a databricks in Azure.

```

environments:

default:

strict_path_adjustment_policy: true

jobs:

- name: "Sample-Training-Job-File"

new_cluster:

spark_version: "10.4.x-scala2.12"

num_workers: 1

node_type_id: "Standard_DS3_v2"

spark_python_task:

python_file: "file://sample/training_file.py"

```

Thank you.

3 REPLIES 3

Prabakar
Databricks Employee
Databricks Employee

@Di Linโ€‹ are you facing any errors while using this code?

dslin
New Contributor III
Hi Prabakar,
Yes, I would have import error if I deploy the code this way. Because the packages (e.g. mlflow, sklearn) are not installed.

Vidula
Honored Contributor

Hi @Di Linโ€‹ 

Hope all is well! Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help. 

We'd love to hear from you.

Thanks!

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