Hi! That is weird.
I could not run it with python 3.10.7 specifically, and I believe that’s the problem here.
dudanogueira@duda-laptop:/tmp$ python -m virtualenv -p 3.10.7 weaviate_test
RuntimeError: failed to find interpreter for Builtin discover of python_spec='3.10.7'
it gave me 3.10.12 when I install 3.10
dudanogueira@duda-laptop:/tmp$ /tmp/weaviate_test/bin/python -m pip install -q requests
dudanogueira@duda-laptop:/tmp$ /tmp/weaviate_test/bin/python
Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> print(requests.get("http://localhost:8080/v1/nodes", headers={"Authorization": "Bearer adminkey"}).content)
b'{"nodes":[{"batchStats":{"queueLength":0,"ratePerSecond":0},"gitHash":"8e46731","name":"node1","shards":null,"stats":{"objectCount":0,"shardCount":0},"status":"HEALTHY","version":"1.21.2"}]}\n'
yeah, that is definitely the issue. If you deliberately run Python 3.10.7, it doesn’t seem to deal well with localhost for some reason:
dudanogueira@duda-laptop:/tmp$ docker run -it python:3.10.7-alpine sh
Unable to find image 'python:3.10.7-alpine' locally
3.10.7-alpine: Pulling from library/python
213ec9aee27d: Pull complete
47858aee13bf: Pull complete
7cd8ea6e04a3: Pull complete
b5146d7f5f1f: Pull complete
91e8f1b6e067: Pull complete
Digest: sha256:486782edd7f7363ffdc256fc952265a5cbe0a6e047a6a1ff51871d2cdb665351
Status: Downloaded newer image for python:3.10.7-alpine
/ # pip install -q requests
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
[notice] A new release of pip available: 22.2.2 -> 23.2.1
[notice] To update, run: pip install --upgrade pip
/ # python
Python 3.10.7 (main, Oct 7 2022, 02:19:38) [GCC 11.2.1 20220219] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> print(requests.get("http://host.docker.internal:8080/v1/nodes", headers={"Authorization": "Bearer adminkey"}).content)
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 203, in _new_conn
sock = connection.create_connection(
File "/usr/local/lib/python3.10/site-packages/urllib3/util/connection.py", line 60, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/usr/local/lib/python3.10/socket.py", line 955, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name does not resolve
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 790, in urlopen
response = self._make_request(
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 496, in _make_request
conn.request(
File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 395, in request
self.endheaders()
File "/usr/local/lib/python3.10/http/client.py", line 1277, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.10/http/client.py", line 1037, in _send_output
self.send(msg)
File "/usr/local/lib/python3.10/http/client.py", line 975, in send
self.connect()
File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 243, in connect
self.sock = self._new_conn()
File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 210, in _new_conn
raise NameResolutionError(self.host, self, e) from e
urllib3.exceptions.NameResolutionError: <urllib3.connection.HTTPConnection object at 0x7f12ac027e80>: Failed to resolve 'host.docker.internal' ([Errno -2] Name does not resolve)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 486, in send
resp = conn.urlopen(
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 844, in urlopen
retries = retries.increment(
File "/usr/local/lib/python3.10/site-packages/urllib3/util/retry.py", line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='host.docker.internal', port=8080): Max retries exceeded with url: /v1/nodes (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x7f12ac027e80>: Failed to resolve 'host.docker.internal' ([Errno -2] Name does not resolve)"))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='host.docker.internal', port=8080): Max retries exceeded with url: /v1/nodes (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x7f12ac027e80>: Failed to resolve 'host.docker.internal' ([Errno -2] Name does not resolve)"))
There seems to be an issue specifically with this python version.
Let me know if that helps 