

Please report any python3 issues if you want to avoid installing a global python2 version.
#PYTHON EMULATOR FOR MAC INSTALL#
Note: If you have problems executing, you can install a global version of latest python2.7.x (even if you have python3.x.x installed).


Run | File "/usr/local/lib/python3.9/site-packages/urllib3/util/connection.py", line 73, in create_connection Run | conn = connection.create_connection( Run | File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 169, in _new_conn Run | trace: Traceback (most recent call last): Run | error: HTTPSConnectionPool(host='::', port=4443): Max retries exceeded with url: /upload/resumable/efbbcde9c49cda2ff78e8da24371ea03 (Caused by NewConnectionError(': Failed to establish a new connection: Address family for hostname not supported')) Put_file("bucketid", file, "blobname") # do put_fileĮrror message: run | running patched getaddrinfo ) # disable https warnings for https insecure certsĬlient_options=ClientOptions(api_endpoint=' _http=http_ssl_disabled,ĭef put_file(bucket_id: str, file, blobname: str):Ĭlient.get_bucket(bucket_id).blob(blob_name=blobname).upload_from_file(file) Patcher = patch('socket.getaddrinfo', side_effect=getaddrinfoIPv4) Return orig_getaddrinfo(host=host, port=port, family=socket.AF_INET, type=type, proto=proto, flags=flags) Sample implementation: from google.cloud import storageįrom google.api_core.client_options import ClientOptionsįrom import AnonymousCredentialsįrom multijob_sample import variables as vsĭef getaddrinfoIPv4(host, port, family=0, type=0, proto=0, flags=0): Referenced answer: Force requests to use IPv4 / IPv6 I have confirmed that requests from a local Python script to the gcs emulator without docker-compose are successful. I’ve implemented the following answer to correct IPv4, but it still seems to be trying to make requests via IPv6.

When I tried, I found out that somehow the gcs client library is trying to make a request to the gcs emulator using IPv6 and failing because IPv6 is not supported by docker for mac. I’m trying to make a request from a python application to a gcs emulator in the docker-compose bridge network in docker for mac. 26th September 2021 docker, docker-for-mac, google-cloud-storage, network-programming, python
