-
Notifications
You must be signed in to change notification settings - Fork 484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ollama gives error Connection refused. #304
Comments
Yes, I'm having the same error. I am trying in Google Colab |
Did anyone find any solution? |
Same issue: httpx.ConnectError: All connection attempts failed |
Hey @nohYoom @Jaswanth-Pillella @ArminFaiom @MAXNORM8650 we're trying to get to the bottom of this. The error message shown doesn't seem like it's running ollama (?). Possible to show us how to reproduce this with Ollama? |
@Jaswanth-Pillella how are you running it Google Colab? |
In Windows 11, running ollama app runs in Windows If you try to access ollama (assuming that you do a ollama run first) through the pyrthon library in WSL (in my case WSL2), you will get a connection refused because the ip address on which ollama app binds to is different under WSL. To get the correct ip address , you can use ipconfig to get the ip address associated with Ethernet adapter vEthernet (WSL) and then use from ollama import ChatResponse, chat, Client client = Client( response: ChatResponse = client.chat(model='llama3.2:1b', messages=[ {'role': 'user', 'content': 'why is sky blue'} ]) print(response['message']['content']) |
File "/home/nohyoom/PycharmProjects/PythonProject/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 89, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: [Errno 111] Connection refused
I tried using Windows, but it didn't work and gave me this error, so I tried WSL, but it still doesn't work.
The text was updated successfully, but these errors were encountered: