# SSLCertVerificationError when loading a model

**URL:** <https://discuss.huggingface.co/t/sslcertverificationerror-when-loading-a-model/12005>\
**Category:** Beginners\
**Created:** [November 18, 2021, 1:47am UTC](https://discuss.huggingface.co/t/sslcertverificationerror-when-loading-a-model/12005 "2021-11-18T01:47:50Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbartkowiak](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@mbartkowiak](https://discuss.huggingface.co/u/mbartkowiak)\
**Post date:** [November 18, 2021, 1:47am UTC](https://discuss.huggingface.co/t/sslcertverificationerror-when-loading-a-model/12005/1 "2021-11-18T01:47:50Z")

</div>

I am exploring potential opportunities of using HuggingFace “Transformers”.

I have been trying check some basic examples from the introductory course, but I came across a problem that I have not been able to solve. I have successfully installed transformers on my laptop using pip, and I have tried to run your “sentiment-analysis” example using Jupyter Notebook, Spider, or Python Command Line.

I am running Python 3.8.5 on Windows 10 behind a company firewall:

- `transformers` version: 4.12.3
- Platform: Windows-10-10.0.19041-SP0
- Python version: 3.8.5
- PyTorch version (GPU?): not installed (NA)
- Tensorflow version (GPU?): 2.7.0 (False)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: NO
- Using distributed or parallel set-up in script?: NO

When I do:

from transformers import pipeline

I get no errors, but when I try:

classifier = pipeline(“sentiment-analysis”)

## I get:

## No model was supplied, defaulted to distilbert-base-uncased-finetuned-sst-2-english ([distilbert/distilbert-base-uncased-finetuned-sst-2-english · Hugging Face](https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english)) HTTPSConnectionPool(host=‘[huggingface.co](http://huggingface.co)’, port=443): Max retries exceeded with url: /distilbert-base-uncased-finetuned-sst-2-english/resolve/main/config.json (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE\_VERIFY\_FAILED] certificate verify failed: unable to get local issuer certificate (\_ssl.c:1123)’)))

followed by a long detailed traceback for SSLCertVerificationError

Any advice on how to proceed?

Thanks a lot  
Miroslaw Bartkowiak

---

<div class="post-metadata">

**Author:** ![Birendra](https://avatars.discourse-cdn.com/v4/letter/b/a6a055/32.png) [@Birendra](https://discuss.huggingface.co/u/Birendra)\
**Post date:** [January 27, 2022, 12:04pm UTC](https://discuss.huggingface.co/t/sslcertverificationerror-when-loading-a-model/12005/2 "2022-01-27T12:04:10Z")

</div>

I’m also getting the same error. Please let me know if any one has resolution for this?

---

<div class="post-metadata">

**Author:** ![ipattis](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ipattis/32/4262_2.png) [@ipattis](https://discuss.huggingface.co/u/ipattis)\
**Post date:** [March 18, 2022, 7:45am UTC](https://discuss.huggingface.co/t/sslcertverificationerror-when-loading-a-model/12005/3 "2022-03-18T07:45:01Z")

</div>

I am getting the same error. Any help here would be much appreciated!

---

<div class="post-metadata">

**Author:** ![roy881020](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@roy881020](https://discuss.huggingface.co/u/roy881020)\
**Post date:** [May 22, 2023, 8:42am UTC](https://discuss.huggingface.co/t/sslcertverificationerror-when-loading-a-model/12005/4 "2023-05-22T08:42:51Z")

</div>

I also have same problem.  
anybody solve it?

---

<div class="post-metadata">

**Author:** ![venkatrajgopal](https://avatars.discourse-cdn.com/v4/letter/v/eb9ed0/32.png) [@venkatrajgopal](https://discuss.huggingface.co/u/venkatrajgopal)\
**Post date:** [December 15, 2023, 5:07pm UTC](https://discuss.huggingface.co/t/sslcertverificationerror-when-loading-a-model/12005/5 "2023-12-15T17:07:57Z")

</div>

Same issue while downloading LLAMA 7B.

```auto
model_id='meta-llama/Llama-2-7b-hf'

```

```auto
Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))"), '(Request ID: 0c7dac02-e1e6-4de6-a585-0e9581c4a24f)')

```

Anyone knows how to fix this. I am on a Mac machine.

---

<div class="post-metadata">

**Author:** ![DaveBowman](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/davebowman/32/16401_2.png) [@DaveBowman](https://discuss.huggingface.co/u/DaveBowman)\
**Post date:** [February 25, 2024, 12:18pm UTC](https://discuss.huggingface.co/t/sslcertverificationerror-when-loading-a-model/12005/6 "2024-02-25T12:18:33Z")

</div>

Try to run this: pip install --trusted-host=[pypi.org](http://pypi.org) --trusted-host=[files.pythonhosted.org](http://files.pythonhosted.org) --user pip-system-certs

---

<div class="post-metadata">

**Author:** ![ranyrotbard](https://avatars.discourse-cdn.com/v4/letter/r/919ad9/32.png) [@ranyrotbard](https://discuss.huggingface.co/u/ranyrotbard)\
**Post date:** [June 26, 2024, 2:13pm UTC](https://discuss.huggingface.co/t/sslcertverificationerror-when-loading-a-model/12005/7 "2024-06-26T14:13:13Z")

</div>

This worked for me! Thanks a lot!

---

<div class="post-metadata">

**Author:** ![RamaUser123](https://avatars.discourse-cdn.com/v4/letter/r/91b2a8/32.png) [@RamaUser123](https://discuss.huggingface.co/u/RamaUser123)\
**Post date:** [August 2, 2024, 4:43am UTC](https://discuss.huggingface.co/t/sslcertverificationerror-when-loading-a-model/12005/8 "2024-08-02T04:43:42Z")

</div>

Worked! Thanks 🙂

---

<div class="post-metadata">

**Author:** ![ellite24](https://avatars.discourse-cdn.com/v4/letter/e/cdc98d/32.png) [@ellite24](https://discuss.huggingface.co/u/ellite24)\
**Post date:** [April 29, 2025, 7:11am UTC](https://discuss.huggingface.co/t/sslcertverificationerror-when-loading-a-model/12005/9 "2025-04-29T07:11:08Z")

</div>

I found another guidance resource for the error message that was faced, You can check out different methods for solving the error in detail at:- [https://cheapsslweb.com/blog/ssl-certificate-verify-failed-error-in-python/](https://cheapsslweb.com/blog/ssl-certificate-verify-failed-error-in-python/). Maybe it would be helpful.
