ollama / ollama-python

Ollama Python library
https://ollama.com
MIT License
2.69k stars 221 forks source link

AttributeError: partially initialized module 'ollama' has no attribute 'chat' (most likely due to a circular import) #144

Open srtj opened 1 month ago

srtj commented 1 month ago

how to fix this error: AttributeError: partially initialized module 'ollama' has no attribute 'chat' (most likely due to a circular import)

ryanbarrett commented 1 month ago

I think I did the same thing and found a resolution.

Is your file named ollama.py? Rename it and try again.

L261173157 commented 1 month ago

I think I did the same thing and found a resolution.

Is your file named ollama.py? Rename it and try again.

yes,you are right

srtj commented 1 month ago

Yes I got it ,thinks

Albert337 commented 1 month ago

when i run "ollama serve" in terminal ,and then i open another terminal to import ollma , i meet the error image and my ollama-python version is 0.1.3 , is there any suggestions?Thanks