Skip to content

Instantly share code, notes, and snippets.

@rodluger
Created June 2, 2021 23:10
Show Gist options
  • Save rodluger/82921d03323dcf0c5580f52a52b69ffe to your computer and use it in GitHub Desktop.
Save rodluger/82921d03323dcf0c5580f52a52b69ffe to your computer and use it in GitHub Desktop.
Hack to allow importing `pymc3` without an internet connection
# Hack to allow importing `pymc3` without an internet connection
# This was fixed in https://github.com/dask/distributed/pull/3991
try:
import distributed
except Exception as e:
try:
import socket
getaddrinfo = socket.getaddrinfo
socket.getaddrinfo = lambda *args: [
[None, None, None, None, ["0.0.0.0"]]
]
import distributed
socket.getaddrinfo = getaddrinfo
except:
raise e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment