pgiri / dispy

Distributed and Parallel Computing Framework with / for Python
https://dispy.org
Other
261 stars 55 forks source link

socket.gaierror: [Errno 8] nodename nor servname provided, or not known #77

Open awhillas opened 7 years ago

awhillas commented 7 years ago

Hey,

I'm trying to run the sample.py from the Canonical Program example with Python 3.6.1 and dispy==4.7.6 running on OSX 10.12.4 and Im getting this error:

2017-05-22 10:08:15 asyncoro - version 4.5.5 with kqueue I/O notifier
2017-05-22 10:08:15 dispy - dispy client version: 4.7.6
Traceback (most recent call last):
  File "sample.py", line 10, in <module>
    cluster = dispy.JobCluster(compute)
  File "/Users/alex/dev/venv/beleghaufen/lib/python3.6/site-packages/dispy/__init__.py", line 2275, in __init__
    recover_file=recover_file)
  File "/Users/alex/dev/venv/beleghaufen/lib/python3.6/site-packages/asyncoro/__init__.py", line 85, in __call__
    cls._instance = super(Singleton, cls).__call__(*args, **kwargs)
  File "/Users/alex/dev/venv/beleghaufen/lib/python3.6/site-packages/dispy/__init__.py", line 688, in __init__
    self.addrinfo = node_addrinfo()
  File "/Users/alex/dev/venv/beleghaufen/lib/python3.6/site-packages/dispy/__init__.py", line 313, in node_addrinfo
    socket_family = socket.getaddrinfo(socket.gethostname(), None)[0][0]
  File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py", line 743, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 8] nodename nor servname provided, or not known

Seems to be OK on Ubuntu 16.4. Must be an OSX thing...?

pgiri commented 7 years ago

This may be because the host name can't be resolved to IP address. Check DNS (domain name server) settings and point it to (correct) server? Alternately, you can specify the IP address of your OS X client with ip_addr parameter to JobCluster.

pgiri commented 7 years ago

Have you tried above / something that fixed it?