1

I'm trying to do the following simple code:

from langchain.schema import HumanMessage, SystemMessage
from langchain_openai import ChatOpenAI

1] If I use it just after installing langchain and langchain_openai I get the following error:

  • ERROR: TypeError: issubclass() arg 1 must be a class
  • LINE: from langchain.schema import HumanMessage, SystemMessage

2] I found multiple answers online that are similar to this: import langchain => Error : TypeError: issubclass() arg 1 must be a class but when I add to my cluster the following installations:

typing-inspect==0.8.0
typing_extensions==4.5.0

Then I get the following:

  • ERROR: ImportError: cannot import name 'Iterator' from 'typing_extensions' (/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/typing_extensions.py)
  • LINE: from langchain_openai import ChatOpenAI

I'm using Databricks with the following:

  • Cluster 1:
    • Runtime: 13.2 ML (includes Apache Spark 3.4.0, GPU, Scala 2.12)
    • Worker & Driver type: Standard_NC21s_v3 224 GB Memory, 2 GPUs
  • Cluster 2:
    • Runtime: 12.2 LTS ML (includes Apache Spark 3.3.2, Scala 2.12)
    • Node type: Standard_DS5_v2 56 GB Memory, 16 Cores
2
  • seems some modules are incompatible. would you try to create a virtual environment and then install these pip install -r requirement.txt requirement.txt, when i tried with these, i received no error(on mac).
    – simpleApp
    Commented Jan 11, 2024 at 13:06
  • @simpleApp Im using databricks, how can I do it on top of it?
    – Dolev Mitz
    Commented Jan 15, 2024 at 4:43

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.