Trying to do basic access of NCBI Entrez via Biopython
1
0
Entering edit mode
9.6 years ago
bfeeny ▴ 50

I am trying to follow the Biopython cookbook to do some basic access of Entrez, but it acts like there is something wrong, as I get:

ERROR:  [Errno 8] nodename nor servname provided, or not known

Here is my basic code:

from Bio import Entrez
import urllib2

try:
    handle = Entrez.einfo()
    result = handle.read()
    print result
except urllib2.HTTPError as e:
    # inform them of the specific error here (based off the error code)
    print "ERROR: ", e.code
except urllib2.URLError as e:
    # inform them of the specific error here
    print "ERROR: ", e.reason
except Exception as e:
    # inform them that a general error has occurred
    print "ERROR: ", e

Any ideas what could be the issue?

Entrez NCBI biopython • 2.5k views
ADD COMMENT
3
Entering edit mode
9.6 years ago
Neilfws 49k

Your code works fine on my machine. Google search for that error suggests a more general problem with network access.

ADD COMMENT
0
Entering edit mode

Thanks I did see an issue going on with DNS resolution. I would also like to add that I should have put an email in my example above like so:

Entrez.email = 'yourname@yourdomain.com'
ADD REPLY
0
Entering edit mode

Yes, this is normally just an intermittent network error, that will go away on its own.

ADD REPLY

Login before adding your answer.

Traffic: 1927 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6