진짜 이 에러땜에 고생 고생 개고생

일일이 라이브러리 파일 다운로드해서 설치하다 하다

승질나서 다른 검색어를 썼더니 에러 발생 조치 방법으로 이게 나옴..

암튼, 아래와 같은 에러가 나오면,

ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: ~~~~

조치 방법으로 다음과 같이 신뢰할 사이트로 등록하면서 설치하면 설치됨.

pip install --trusted-host pypi.python.org --trusted-host pypi.org --trusted-host files.pythonhosted.org 설치할패키지명

아휴..

참고사이트 :

https://better-than-alone.tistory.com/42

https://6developer.com/947

 

구글링으로 찾은 또다른 방법 1

pip의 config 파일에 --trusted-host <hostname> 을 넣어두면, 'pip install 라이브러리' 만으로도 설치가 됨.

1. config 파일을 생성 (이미 있으면, 그걸 사용하거나 없으면 해당 위치에서 폴더와 파일을 생성하여 아래 내용을 추가)

    1) 맥 OS : $HOME/Library/Application Support/pip/pip.conf 이나 $HOME/.config/pip/pip.conf.

    2) 윈도우 : %APPDATA%\pip\pip.ini 이나 %HOME%\pip\pip.ini

2. 내용 추가

[global]
trusted-host = pypi.org
               files.pythonhosted.org

출처: https://curryyou.tistory.com/179 

 

구글링으로 찾은 또다른 방법 2 (리눅스 환경)

alias로 아예 pip 명령어 쓸때 --trusted-host 내용들 같이 적어버리게 등록해버리기

vi로 ~/.bashrc 파일을 열어 제일 마지막에 다음 내용을 추가

alias pip='pip --trusted-host pypi.org --trusted-host files.pythonhosted.org'

출처 : https://harryp.tistory.com/831

+ Recent posts