[Python] URLError: <urlopen error [Errno -3] Temporary failure in name resolution> while using...

Discussão em 'Python' iniciado por Stack, Março 2, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to import Bio and read an Entrez object


    from Bio import Entrez
    Entrez.email = "some_email@example.com"
    handle = Entrez.einfo()
    print(handle.read())


    i'm getting this error:

    ---------------------------------------------------------------------------
    gaierror Traceback (most recent call last)
    /usr/lib/python3.11/urllib/request.py in do_open(self, http_class, req, **http_conn_args)
    1347 try:
    -> 1348 h.request(req.get_method(), req.selector, req.data, headers,
    1349 encode_chunked=req.has_header('Transfer-encoding'))

    17 frames
    gaierror: [Errno -3] Temporary failure in name resolution

    During handling of the above exception, another exception occurred:

    URLError Traceback (most recent call last)
    /usr/lib/python3.11/urllib/request.py in do_open(self, http_class, req, **http_conn_args)
    1349 encode_chunked=req.has_header('Transfer-encoding'))
    1350 except OSError as err: # timeout error
    -> 1351 raise URLError(err)
    1352 r = h.getresponse()
    1353 except:

    URLError: <urlopen error [Errno -3] Temporary failure in name resolution>




    i've tried changing my DNS to google 8 8 8 8 and 8 8 4 4 , but it didn't work. Network is working fine and i'm able to search, but this code snippet suddenly crashed from last night. also if it is important, I'm using google colab for it. also, the version of Biopython i'm working with is 1.85 and i tried different older versions, but the problem remained the same.

    Any help would be appreciated

    Continue reading...

Compartilhe esta Página