ImportError: cannot import name 'PILLOW_VERSION' from 'PIL' 에러 해결
개발환경 - ubuntu18.04 - python3.7 1. Problem ImportError: cannot import name 'PILLOW_VERSION' from 'PIL' pillow를 설치했는데도 불구하고 import가 되지않는 error 발생 (9.0.1 버전이 설치 되어있었음) 2. Reason from PIL import Image, ImageOps, ImageEnhance, PILLOW_VERSION pillow의 버전이 너무 높아서 발생하는 문제 3. Solution pillow version = (1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.5, 1.7.6, 1.7.7, 1.7.8, 2.0.0,..
2022. 3. 31.
python 두 점 사이의 중심좌표 구하는 법
서로 떨어진 두 점을 matplotlib으로 그려보자. import matplotlib.pyplot as plt x1, y1 = 300, 350 x2, y2 = 200, 150 plt.xlim(100, 400) plt.ylim(100, 400) plt.scatter([x1, x2], [y1, y2]) plt.show() center x - (x1 + x2) / 2 center y - (y1 + y2) / 2 이 공식을 이용하면 그래프에 그려진 빨간점 처럼 중심 좌표를 구할 수 있다. center_coordinate_x = (x1 + x2)/2 center_coordinate_y = (y1 + y2)/2 print(center_coordinate_x, center_coordinate_y) plt.xlim(..
2022. 3. 22.