โ05-09-2023 04:00 PM
Hi Everyone,
I'm planning to use databricks python cli "install_libraries"
can some one pls post examples on function install_libraries
https://github.com/databricks/databricks-cli/blob/main/databricks_cli/libraries/api.py
โ05-10-2023 07:24 AM
okay, i figured it out , here is the example
from databricks_cli.sdk.api_client import ApiClient
from databricks_cli.libraries.api import LibrariesApi
awsapi_client = ApiClient(
host="********************",
token="*******************",
)
awslibrary_api = LibrariesApi(awsapi_client)
awslibrary_api.install_libraries('0510-140152-aaaaaaaa', {'pypi': {'package': 'mlflow==2.2.2'}} )
โ05-10-2023 12:09 AM
@saiprasad ambati prabhakarโ Are you having any issues while installing that?
โ05-10-2023 06:50 AM
i dont have any issues with installation, im looking for examples to use the python function install_libraries , i want to install libraries via python sdk
โ05-10-2023 05:14 AM
databricks libraries install --cluster-id 1234-567890-lest123 --jar dbfs:/test-dir/test.jar
Doc : https://docs.databricks.com/dev-tools/cli/libraries-cli.html
โ05-10-2023 06:51 AM
hi @Artem Sheikoโ , im looking for python sdk example to install libraries in the cluster, pls let me know if you have any
โ
here is the github link im following
โhttps://github.com/databricks/databricks-cli/blob/main/databricks_cli/libraries/api.py
โ11-14-2023 11:14 AM
Hello! I was able to install a library using python sdk - Task configuration. Please see the code below! Hope it helps! ๐
from databricks.sdk.service.jobs import Task
from databricks.sdk.service.compute import ( Library,
PythonPyPiLibrary,
)
Task(...<other config>,
libraries=[Library(pypi=PythonPyPiLibrary(package="package_name==version"))],
)
โ05-10-2023 07:24 AM
okay, i figured it out , here is the example
from databricks_cli.sdk.api_client import ApiClient
from databricks_cli.libraries.api import LibrariesApi
awsapi_client = ApiClient(
host="********************",
token="*******************",
)
awslibrary_api = LibrariesApi(awsapi_client)
awslibrary_api.install_libraries('0510-140152-aaaaaaaa', {'pypi': {'package': 'mlflow==2.2.2'}} )
โ08-25-2023 07:15 AM
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