1

i try to use pygithub module, an error occurred in tutorial code.

an error occurs that 'socket.gaierror: [Errno -2] Name or service not known', i don't know why.

this is my tutorial code:

user = Github("id", "password")

publicRepos = user.get_repos()

for repo in publicRepos:
    print repo.name

and i get the following error:

          .
          .
          .
          .

File "/usr/lib64/python2.7/httplib.py", line 969, in endheaders
  self._send_output(message_body)
File "/usr/lib64/python2.7/httplib.py", line 829, in _send_output
  self.send(msg)
File "/usr/lib64/python2.7/httplib.py", line 791, in send
  self.connect()
File "/usr/lib64/python2.7/httplib.py", line 1172, in connect
  self.timeout, self.source_address)
File "/usr/lib64/python2.7/socket.py", line 553, in create_connection
  for res in getaddrinfo(host, port, 0, SOCK_STREAM):
socket.gaierror: [Errno -2] Name or service not know

please tell me how to solve.

0 Answers0