Created
June 2, 2021 23:10
-
-
Save rodluger/82921d03323dcf0c5580f52a52b69ffe to your computer and use it in GitHub Desktop.
Hack to allow importing `pymc3` without an internet connection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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