Docker for mac - python sdk - can't connect to local daemon

I am trying to connect to my local docker for mac, from the python sdk. I am able to run the same code on windows without problems, but can’t connect on macos (arm)

I am having the following code, in line with sample provided at Docker SDK for Python — Docker SDK for Python 6.1.3 documentation (

import docker
client = docker.from_env()

this raises the following exception:
raise DockerException(
docker.errors.DockerException: Error while fetching server API version: (‘Connection aborted.’, FileNotFoundError(2, ‘No such file or directory’))

any help?