python - URLError: <urlopen error [Errno -3] Temporary failure in name resolution> while using Biopython - Stack O

admin2025-04-20  0

I am trying to import Bio and read an Entrez object


    from Bio import Entrez
    Entrez.email = "[email protected]"
    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

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745123377a286281.html

最新回复(0)