Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 에서 pip install 시 SSLCertVerificationError 발생하는 경우 #175

Open
occidere opened this issue Apr 6, 2023 · 0 comments
Assignees
Labels

Comments

@occidere
Copy link
Owner

occidere commented Apr 6, 2023

상황

  • local PC 는 Zscaler 로 VPN 을 통해 네트워크 연결이 되어 있음

  • local 에서 pip install 을 통해 패키지를 설치하려고 하면 아래와 같이 SSLCertVerificationError 가 발생

     $ pip3 install beautifulsoup4
    
     zsh: /usr/local/Homebrew/bin/pip3: bad interpreter: /usr/local/Homebrew/opt/[email protected]/bin/python3.9: no such file or directory
     WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)'))': /simple/beautifulsoup4/
     WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)'))': /simple/beautifulsoup4/
     WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)'))': /simple/beautifulsoup4/
     WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)'))': /simple/beautifulsoup4/
     WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)'))': /simple/beautifulsoup4/
     Could not fetch URL https://pypi.org/simple/beautifulsoup4/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/beautifulsoup4/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)'))) - skipping
     ERROR: Could not find a version that satisfies the requirement beautifulsoup4 (from versions: none)
     ERROR: No matching distribution found for beautifulsoup4
    

원인

  • Zscaler 쪽에서 파이썬 패키지 저장소 중 하나인 pypi.python.org 로의 연결이 제한됨

해결

  • 하지만 2018년 이후 pypi.org 를 대신 사용중이기 때문에 굳이 pypi.python.org 로 접근할 필요가 없으므로 아래와 같이 커맨드를 입력하여 우회하면 됨
    pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org {설치할 패키지 이름}
  • 영구적인 해결 방법은 참고 링크 확인

참고

@occidere occidere added the Python label Apr 6, 2023
@occidere occidere self-assigned this Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant