[Biopython] BioPython URLError

Jeffrey Posey jp7363 at nyu.edu
Thu Nov 16 19:34:08 EST 2023


Running the code below prior to my initial code enabled functionality and
subsequent outputs

import ssl

try:
    _create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
    # Legacy Python that doesn't verify HTTPS certificates by default
    pass
else:
    # Handle target environment that doesn't support HTTPS verification
    ssl._create_default_https_context = _create_unverified_https_context

On Wed, Nov 15, 2023 at 1:34 PM Iddo Friedberg <idoerg at gmail.com> wrote:

> Also, in case the error is continuing: which OS are you using? If it's
> windows, there may be a certificate library issue. Look here for possible
> solutions:
>
>
> https://stackoverflow.com/questions/51390968/python-ssl-certificate-verify-error
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__stackoverflow.com_questions_51390968_python-2Dssl-2Dcertificate-2Dverify-2Derror&d=DwMFaQ&c=slrrB7dE8n7gBJbeO0g-IQ&r=wTh6pI_uB_2VwyV3g4NSuw&m=RjCVFCKpxMHA4Gbq1Jp3ehPwVaFiHEorWAE0KT7hfzkJU71suHG7wrsOYLF4JOia&s=IE610YRQ1oC4f-Uob7iRfafeKAinG0nTNnQCKh-QPIM&e=>
>
> For general troubleshooting of a possible certificate error, it is
> possibly best to Google the error, since these things can be platform / OS
> specific:
>
>
> https://www.google.com/search?q=certificate+verify+failed%3A+self+signed+certificate+in+certificate+chain
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__www.google.com_search-3Fq-3Dcertificate-2Bverify-2Bfailed-253A-2Bself-2Bsigned-2Bcertificate-2Bin-2Bcertificate-2Bchain&d=DwMFaQ&c=slrrB7dE8n7gBJbeO0g-IQ&r=wTh6pI_uB_2VwyV3g4NSuw&m=RjCVFCKpxMHA4Gbq1Jp3ehPwVaFiHEorWAE0KT7hfzkJU71suHG7wrsOYLF4JOia&s=5KgG3Jcy58deHFbPesBrK9hJwY7jflzHMgcGf7619kI&e=>
>
> On Wed, Nov 15, 2023 at 3:26 PM Iddo Friedberg <idoerg at gmail.com> wrote:
>
>> Looks like a glitch, since I couldn't duplicate it (I did receive 100 IDs
>> in "record").
>>
>> Is it working now, Jeffrey?
>>
>> On Wed, Nov 15, 2023 at 9:40 AM Jeffrey Posey <jp7363 at nyu.edu> wrote:
>>
>>> I've downloaded BioPython to my Jupyter notebook terminal, entered the
>>> code from BioPython notebook (below), and it results in a URLError. What
>>> might be the problem?
>>>
>>> from Bio import Entrez
>>> Entrez.email = " jp7363 at nyu.edu".
>>> handle = Entrez.esearch(db ="protein", retmax = 100, term=" COVID-19
>>> surface glycoprotein")
>>> record = Entrez.read(handle)
>>>
>>> URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1002)>
>>>
>>> _______________________________________________
>>> Biopython mailing list  -  Biopython at biopython.org
>>> https://mailman.open-bio.org/mailman/listinfo/biopython
>>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__mailman.open-2Dbio.org_mailman_listinfo_biopython&d=DwMFaQ&c=slrrB7dE8n7gBJbeO0g-IQ&r=wTh6pI_uB_2VwyV3g4NSuw&m=RjCVFCKpxMHA4Gbq1Jp3ehPwVaFiHEorWAE0KT7hfzkJU71suHG7wrsOYLF4JOia&s=01l05azZH_8GMaCtfxgdYxMXwdcwAyJWhewMfvdA1nU&e=>
>>>
>>
>>
>> --
>> Iddo Friedberg
>>
>> ++++++++++[>+++>++++++>++++++++>++++++++++>+++++++++++<<<<<-]>>>>++++.>
>> ++++++..----.<<<<++++++++++++++++++++++++++++.-----------..>>>+.-----.
>> .>-.<<<<--.>>>++.>+++.<+++.----.-.<++++++++++++++++++.>+.>.<++.<<<+.>>
>> >>----.<--.>++++++.<<<<------------------------------------.
>>
>
>
> --
> Iddo Friedberg
>
> ++++++++++[>+++>++++++>++++++++>++++++++++>+++++++++++<<<<<-]>>>>++++.>
> ++++++..----.<<<<++++++++++++++++++++++++++++.-----------..>>>+.-----.
> .>-.<<<<--.>>>++.>+++.<+++.----.-.<++++++++++++++++++.>+.>.<++.<<<+.>>
> >>----.<--.>++++++.<<<<------------------------------------.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biopython/attachments/20231116/5450a6cb/attachment.htm>


More information about the Biopython mailing list