transformers icon indicating copy to clipboard operation
transformers copied to clipboard

SSLError: HTTPSConnectionPool(host='huggingface.co', port=443)

Open alexsomoza opened this issue 2 years ago • 3 comments

I'm trying in python:

from sentence_transformers import SentenceTransformer sbert_model = SentenceTransformer('all-MiniLM-L6-v2')

and I get this error:

SSLError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /api/models/sentence-transformers/all-MiniLM-L6-v2 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1091)')))

I have no proxy, just getting direct to internet !!!

alexsomoza avatar Jun 08 '22 15:06 alexsomoza

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Jul 09 '22 15:07 github-actions[bot]

same error import requests requests.get('https://www.huggingface.co') SSLError: HTTPSConnectionPool(host='www.huggingface.co', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)')))

1feres1 avatar Jul 14 '22 08:07 1feres1

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Aug 07 '22 15:08 github-actions[bot]

I'm also getting the same issue now :(

Moshekwa avatar Oct 19 '22 12:10 Moshekwa

Define Sentence Transformer

embedder = SentenceTransformer('paraphrase-MiniLM-L6-v2')

SSLError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /api/models/sentence-transformers/paraphrase-MiniLM-L6-v2 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)')))

Moshekwa avatar Oct 19 '22 12:10 Moshekwa

downgrading requests to 2.27.1 + import os os.environ['CURL_CA_BUNDLE'] = '' will solve the problem

1feres1 avatar Nov 22 '22 08:11 1feres1

Hello, I am still getting the same error :(

AgrawalAakashh0523 avatar Dec 01 '22 22:12 AgrawalAakashh0523

Hello, Yes still getting the same error. Downgrading requests did not work

shinem1199 avatar Jan 04 '23 17:01 shinem1199

I'm also struggling with this error.

evanmcfarland avatar Jan 27 '23 16:01 evanmcfarland

I'm also struggling with this error.

Use this inside your python code !!!!

import os os.environ['CURL_CA_BUNDLE'] = ''

and you get away from the problem !!!!!

alexsomoza avatar Jan 27 '23 16:01 alexsomoza

@alexsomoza Thanks for the suggestion. It's not working. Although Initially, it did work till downloading packages but after few minutes Readtimeout error is thrown as below. Looks like corporate security(Zscalar) is blocking the download. Have raised issue with the tech support team within the organization as well Readtimeout1-HuggingFace Readtimeout2-HuggingFace

shinem1199 avatar Jan 29 '23 16:01 shinem1199

It works, thank you!

Luoyang144 avatar Feb 17 '23 06:02 Luoyang144

Thanks it works if you do not forget to downgrade requests to 2.27.1 !!!

edmondja avatar Feb 21 '23 13:02 edmondja

你的问题解决了吗?怎么解决的?

1264561652 avatar Mar 15 '23 06:03 1264561652

你的问题解决了吗?怎么解决的? 代码里加两行就好了 import os os.environ['CURL_CA_BUNDLE'] = ''

joisonwk avatar Mar 30 '23 09:03 joisonwk

Meet the same question.. Adding the 2 line code below seams bloking in downloading model

xzc-Eureka avatar Apr 07 '23 17:04 xzc-Eureka

Same issue here

requests.exceptions.ProxyError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /facebook/vit-mae-base/resolve/main/preprocessor_config.json (Caused by ProxyError('Cannot connect to proxy.', timeout('timed out')))

SunHaozhe avatar May 04 '23 08:05 SunHaozhe

It seems my proxy failed to cause this. Directly export proxy in .zshrc work for me.

export https_proxy=http://127.0.0.1:7890
export http_proxy=http://127.0.0.1:7890
export all_proxy=socks5://127.0.0.1:7890

source ~/.zshrc

cjl99 avatar May 08 '23 04:05 cjl99

same issue here, + 2line and downgrade requests not work

fortunechen avatar May 08 '23 07:05 fortunechen

Downgrading requests to 2.27.1 and using the import os code mentioned above worked for me. But only for python 3.9 and higher. It didn't work for 3.8

tvaranka avatar May 12 '23 05:05 tvaranka

Downgrading requests to 2.27.1 and using the import os code mentioned above worked for me. But only for python 3.9 and higher. It didn't work for 3.8

I tried with Python 3.11. 3 and it didn't work.

requests==2.27.1 transformers==4.29.2

zazke avatar May 18 '23 18:05 zazke

Could you try with 3.9? And just to confirm you pasted the below code on top of your main file? Single quotes, not double.

import os
os.environ['CURL_CA_BUNDLE'] = ''

I tried with 3.11, but don't remember the specific version and it worked fine. Maybe there is something else that could be causing the error

tvaranka avatar May 19 '23 13:05 tvaranka

Could you try with 3.9? And just to confirm you pasted the below code on top of your main file? Single quotes, not double.

import os
os.environ['CURL_CA_BUNDLE'] = ''

I tried with 3.11, but don't remember the specific version and it worked fine. Maybe there is something else that could be causing the error

same error,why does this happen

danyow-cheung avatar May 26 '23 10:05 danyow-cheung

same issue

hoonlight avatar Jun 05 '23 04:06 hoonlight

same issue in python 3.7

ShoupingShan avatar Jun 06 '23 03:06 ShoupingShan

Same issue in python 3.9 and python 3.10 Setting export CURL_CA_BUNDLE="" is not working. requests downgraded to 2.27.1 as well.

ShashwatNigam99 avatar Jun 14 '23 02:06 ShashwatNigam99

Had the same error and was trying the above fixes (it didn't help) for the last hour. It started to work again, with no changes from my side, so it seems to have been external/repo issue.

mhoffmann1 avatar Jun 14 '23 11:06 mhoffmann1

same issue in python 3.9.0

joisonwk avatar Jun 16 '23 13:06 joisonwk

works for me with 3.9.16

tiansiyuan avatar Jun 19 '23 09:06 tiansiyuan

Having this same issue

dem1995 avatar Jun 21 '23 16:06 dem1995