Same question :ImportError: cannot import name 'Ollama' from 'langchain.llms'
Langchain has moved all llm models to their own modules. You need to install pip install -U langchain-ollama
. Then you can use it without any issues.
The official page : reference