Programming,  Python

[Python] pip Install 시 SSLError

pip을 통해 python에서 사용되는 각종 package들을 설치하는 도중 다음과 같은 error가 발생했다.

$ pip install --proxy https://http://123.456.789: --trusted-host pypi.python.org --trusted-host pypi.org --trusted-host files.pythonhosted.org SciPy
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)'))': /simple/scipy/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)'))': /simple/scipy/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)'))': /simple/scipy/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)'))': /simple/scipy/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)'))': /simple/scipy/
Could not fetch URL https://pypi.org/simple/scipy/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/scipy/ (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)'))) - skip
ERROR: Could not find a version that satisfies the requirement SciPy (from versions: none)
ERROR: No matching distribution found for SciPy
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)'))) - skipping

현재 proxy server를 통해 우회해서 패키지들을 설치하과 있는데, 원인을 보니 proxy server의 https가 아닌 http로 지정해야 했다.

$ pip install --proxy http://123.456.789 --trusted-host pypi.python.org --trusted-host pypi.org --trusted-host files.pythonhosted.org SciPy
Collecting SciPy
  Downloading scipy-1.7.2-cp37-cp37m-win_amd64.whl (34.1 MB)
     |████████████████████████████████| 34.1 MB 6.4 MB/s
Collecting numpy<1.23.0,>=1.16.5
  Downloading numpy-1.21.4-cp37-cp37m-win_amd64.whl (14.0 MB)
     |████████████████████████████████| 14.0 MB 6.8 MB/s
Installing collected packages: numpy, SciPy
  Attempting uninstall: numpy
    Found existing installation: numpy 1.16.4
    Uninstalling numpy-1.16.4:
      Successfully uninstalled numpy-1.16.4
Successfully installed SciPy-1.7.2 numpy-1.21.4

그리고 정상적으로 설치가 되는 것을 볼 수 있었다.

Leave a Reply

Your email address will not be published. Required fields are marked *