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

Open
opened 2026-02-15 16:27:54 -05:00 by yindo · 4 comments
Owner

Originally created by @srtj on GitHub (May 2, 2024).

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

Originally created by @srtj on GitHub (May 2, 2024). how to fix this error: AttributeError: partially initialized module 'ollama' has no attribute 'chat' (most likely due to a circular import)
Author
Owner

@ryanbarrett commented on GitHub (May 2, 2024):

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

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

@ryanbarrett commented on GitHub (May 2, 2024): I think I did the same thing and found a resolution. Is your file named ollama.py? Rename it and try again.
Author
Owner

@L261173157 commented on GitHub (May 6, 2024):

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

@L261173157 commented on GitHub (May 6, 2024): > 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
Author
Owner

@srtj commented on GitHub (May 7, 2024):

Yes I got it ,thinks

@srtj commented on GitHub (May 7, 2024): Yes I got it ,thinks
Author
Owner

@Albert337 commented on GitHub (May 28, 2024):

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

@Albert337 commented on GitHub (May 28, 2024): when i run "ollama serve" in terminal ,and then i open another terminal to import ollma , i meet the error ![image](https://github.com/ollama/ollama-python/assets/33714840/dca4117d-1ade-4157-9f9e-b1231efbdc9a) and my ollama-python version is 0.1.3 , is there any suggestions?Thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#79