cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Administration & Architecture
Explore discussions on Databricks administration, deployment strategies, and architectural best practices. Connect with administrators and architects to optimize your Databricks environment for performance, scalability, and security.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

databricks-langchain PyPI installation stuck for 30+ minutes on multiple Azure Databricks clusters

HariUmeshNaraya
New Contributor II

Team,

I am experiencing an issue installing the databricks-langchain Python package from PyPI on Azure Databricks.

The package installation remains in the installing/resolving state for more than 30 minutes and does not complete.

Testing performed:

  1. Original cluster:
    • Databricks Runtime: 16.4 LTS
    • Spark: 3.5.2
    • Scala: 2.12
    • Node type: Standard_D4s_v3
  2. Created a completely new cluster with the same configuration. The issue remained.
  3. Created another new cluster with:
    • Databricks Runtime: 17.3 LTS
    • Spark: 4.0.0
    • Scala: 2.13
    • Node type: Standard_D4ds_v4
    • Single node
    • Photon enabled
  4. On the new cluster, other PyPI libraries install successfully.
  5. However, databricks-langchain continues to remain in the installing/resolving state for an extended period.
  6. I also attempted installation using notebook %pip install databricks-langchain, with the same behavior.

This appears to be specific to databricks-langchain rather than a general cluster startup or PyPI connectivity issue.

Could you please investigate whether there is currently an issue with installing/resolving databricks-langchain on Databricks Runtime 16.4/17.3, or whether there is a known dependency-resolution issue?

Package: databricks-langchain

Please also advise whether there are any recommended package/version combinations for this runtime.

I can provide cluster IDs, workspace information, library installation logs, and screenshots if required

3 REPLIES 3

DoTA
Valued Contributor II

This pattern - one package sits at "resolving" for 30+ minutes while everything else installs fine - is almost always pip's backtracking resolver rather than a PyPI outage. databricks-langchain pulls a deep tree (langchain-core, langgraph, mlflow, pydantic, tenacity, ...) and several of those have constraints that clash with what DBR 16.4 / 17.3 already ship, so pip walks backwards through old releases trying to find a consistent set, downloading each one.

 

What has worked for us:

 

1. Run it notebook-scoped with -v so you can actually see it: %pip install -v databricks-langchain. If you see "This is taking longer than usual... backtracking", that confirms it is dependency resolution.

 

2. Constrain the tree so pip does not backtrack. Pin the package plus its heavy deps to versions compatible with the runtime, e.g. %pip install "databricks-langchain==<latest on PyPI>" "mlflow==<the version already on the runtime>" "langchain-core>=0.3,<0.4". The upper bounds matter more than the exact pins.

 

3. Add --only-binary=:all: to rule out a source build. If a transitive dep has no wheel for the runtime's Python (3.12 on both 16.4 and 17.3), pip tries to compile it, which looks like a hang. --only-binary=:all: fails fast and names the offender.

 

4. Cluster-UI library installs retry silently and are hard to watch - use %pip while iterating, then move the working pin set to the cluster library list or an init script once it resolves.

 

5. Longer term, do not resolve this on every cluster start. Bake the pinned set into an init script, a serverless environment spec, or a custom container, and/or point pip at an Azure Artifacts PyPI cache so you are not re-hitting pypi.org each time.

 

If it still hangs with a fully pinned --only-binary command, grab the -v log - the last few lines before it stalls will name the package it cannot satisfy.

HariUmeshNaraya
New Contributor II

I am not clear about the solution that you are recommending here..  i am able to install other libraries for sure.. 
Do you think does this library need pre-required library to be installed such as langchain, langchain-core etc..?

i don't prefer installing using pip as this model is part of agentic invocation..

ivanvyd
New Contributor III

@HariUmeshNaraya you shouldn't need to install langchain or langchain-core beforehand. A normal installation of databricks-langchain resolves and installs its declared dependencies automatically.

You can keep using the cluster's Libraries tab for notebooks and jobs on that cluster. The earlier %pip install -v suggestion is a separate notebook-scoped installation with verbose output, not something to run during each agent invocation.

Since you already tried %pip, Iโ€™d start with the installation logs you mentioned. Backtracking is possible, but I wouldn't choose version pins without seeing the output. Messages such as "pip is looking at multiple versions" would support that diagnosis.

Could you share the log section where progress stops and the exact package specification, including any version pin? Please redact credentials and private repository details.

Ivan Vydrin
Lead Software & AI Engineer ยท Tech Fabric LLC