ollama-python icon indicating copy to clipboard operation
ollama-python copied to clipboard

Python 3.12.2 Cannot import ollama

Open Ray0907 opened this issue 11 months ago • 5 comments

I attempted to utilize the example, but encountered some errors as follows. Python 3.12.2 (main, Feb 6 2024, 20:19:44) [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin

import ollama
from ollama import create
ImportError: cannot import name 'create' from partially initialized module 'ollama' (most likely due to a circular import) 

Ray0907 avatar Mar 12 '24 14:03 Ray0907

@Ray0907 rename your file from ollama.py to something different like test.py. It helped me. also keep in mind you need to install ollama with pip pip3 install ollama

hanov avatar Mar 28 '24 18:03 hanov

The ollama python api takes much longer time than ollama command line. why is that?

ibrahim-string avatar May 22 '24 06:05 ibrahim-string

The ollama python api takes much longer time than ollama command line. why is that?

when i use ollama python api, i meet the eroor as following image What I'm thinking is that the LLM model hasn't been called yet, is there any suggestions?Thanks

Albert337 avatar May 28 '24 07:05 Albert337

I've just uninstalled with 'pip uninstall ollama' and install again with 'pip3'. Also, I renamed my file and it works.

wyctorfogos avatar Sep 21 '24 21:09 wyctorfogos