본문 바로가기

에러/python7

[Jupyter Notebook] OSError: [Errno 99] Cannot assign requested address 에러 우분투 서버에서 주피터 노트북 실행 시 발생하는 에러로 OSError: [Errno 99] Cannot assign requested address 라고 주소를 할당할 수 없다는 메시지가 출력된다. 이는 ip 주소를 제대로 지정해주지 못한 경우로 다음과 같이 -ip=0.0.0.0 으로 지정해주면 정상적으로 실행된다. jupyter notebook –ip=0.0.0.0 –port=8888 –allow-root 2021. 1. 8.
[Python] urllib has no attribute quote 에러 urllib.quote() 를 사용하고자 할 때 생기는 에러로 urllib has no attribute quote 다음과 같이 quote가 없다고 에러를 발생시킨다. 이럴 경우 urllib가 아니라 urllib.parse 를 임포트한 후 사용하면 된다. import urllib.parse urllib.parse.quote("test") 2021. 1. 8.
resize 에러 에러 : ValueError: Input images must have the same dimensions 해결 : shape로 resize 시 3개의 인자를 받아야 하는데 H, W 두 개만 받아 발생 (H, W) --> (H, W, d)(H, W, d) = imageA.shapeimageB = cv2.resize(imageB, (H, W)) 2020. 11. 29.
TypeError: slice indices must be integers or None or have an __index__ method 에러 TypeError: slice indices must be integers or None or have an __index__ method 에러 에러 내용: TypeError: slice indices must be integers or None or have an __index__ method int/int 는 float 형으로 출력된다. len(s)/2 를 len(s)//2 로 고치면 해결된다. 2020. 11. 14.
cv2.findContours 에러 cv2.findContours를 처리하는 줄에서 에러가 발생하였다. ValueError: not enough values to unpack (expected 3, got 2) 다음의 에러 문구를 출력하였는데, OpenCV 3.4.3 이하 버전에서는 코드를 달리 작성해야 하는 것 같다. 예제를 보고 _, contours, _ = cv2.findContours(…)와 같이 작성하였는데, contours, _ = cv2.findContours(…) 로 작성하니 정상 작동하였다. 2020. 11. 5.
[conda] command not found error your shell has not been properly configured to use conda activate 에러 anaconda 가상환경 생성 후 activate이 되지 않을 때 내용: command not found error your shell has not been properly configured to use conda activate 해결: source ~/anaconda3/etc/profile.d/conda.sh 실행 후 conda activate 2020. 10. 4.