잠토의 잠망경

[Python] pip 오류시 대안 본문

공부/Python

[Python] pip 오류시 대안

잠수함토끼 2020. 4. 5. 11:58

문제 상황


 

오류 메시지


Could not fetch URL https://pypi.org/simple/sklearn/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/sklearn/ (Caused by SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)) - skipping

 

python 2.7 종료 때문이지 pip download가 정상적으로 되지 않는다.

 

대안


pip site에서 메뉴얼로 다운로드 한다.

파일의 종류에 따라 설치 과정은 두가지 이다.

 

1. *.whl

$ pip install --no-index --find-links=. tensorflow

 

2. 압축파일인 경우

 

 

압축 내용중 두 개를 copy한다.

 

 

다음을 아래 경로에 copy한다.

venv\Lib\site-packages\

 

아래 같이 추가된 걸 확인 가능하다.

 

test code


import numpy as np
from dtw import dtw

x = np.asarray([1,2,3,4,5])
y = np.asarray([2,3,4,5,6])

manhattan_distance = lambda x, y: np.abs(x - y)

d, cost_matrix, acc_cost_matrix, path = dtw(x, y, dist=manhattan_distance)

print(d)

 

 

참고 필요 packages


  package 명 URL
1 numpy https://pypi.org/project/numpy/1.16.6/#files
2 dtw  
3 scipy https://pypi.org/project/scipy/1.2.3/#files
Comments