티스토리 뷰

Development

Anaconda SSL connection errors

RCE_Mania 2020. 8. 1. 15:29

Anaconda SSL connection errors

아나콘다를 설치하고 나서 'conda update conda'를 하거나 새로운 env를 생성할때 아래와 같은 오류를 만날 수 있다.

Collecting package metadata (current_repodata.json): failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/win-64/current_repodata.json>
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.

If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.

SSLError(MaxRetryError('HTTPSConnectionPool(host=\'repo.anaconda.com\', port=443): Max retries exceeded with url: /pkgs/main/win-64/current_repodata.json (Caused by SSLError("Can\'t connect to HTTPS URL because the SSL module is not available."))'))

SSL 연결 오류로 아나콘다 리포에 접근을 못하는 경우이다. 나같은 경우에는 브라우저를 통해 해당 URL에 접근했을때는 정상적으로 접근이 가능했으나, CONDA 콘솔에서는 에러가 발생해 구글링을 통해 찾은 여러 솔루션을 적용해 봤지만 실패했다.

Solution #1 - SSL config modify

아나콘다 config파일에 ssl_verify 옵션에 false를 적용하여 SSL 없이 통신을 하게만드는 셋팅이지만 해당 설정을 적용해도 같은 오류가 발생했다.

$> conda config --set ssl_verify false

Solution #2 - add to pem file

openssl을 통해 인증서를 생해 conda 통신에 사용하는 방법이다. 이 방법도 마찬가지로 같은 오류가 발생했다.

$> openssl s_client -showcerts -servername "www.anaconda.com" -connect www.anaconda.com:443 > cacert.pem
$> conda config --set ssl_verify cacert.pem

Solution #3 - PATH Setting

좀 더 살펴본 결과 공식 홈페이지에서 관련 오류 해결에 대한 내용을 찾았다. anaconda 관련 path들을 $PATH에 추가해 해결하는 방법이다. 추가해야될 경로는 아래와 같다.

  • (install root)
  • (install root)/Library/mingw-w64/bin
  • (install root)/Library/usr/bin
  • (install root)/Library/bin
  • (install root)/Scripts
  • (install root)/bin
  • (install root)/condabin

윈도우10 64bit환경에서 최신버전(2020년 07월)에서 위와 같은 설정으로 문제 해결하여 정상 동작되었다.

'Development' 카테고리의 다른 글

Github Page with Jekyll  (0) 2020.12.09
댓글