2025/08/06
1. 제거
일단 아래와 같이 설치 되어 있는 numpy, openCV 관련된 내용 모두 제거
pip uninstall numpy opencv-python opencv-contrib-python opencv-python-headless -y
2. 설치
1. NumPy 설치
pip install numpy==2.3.2
2. OpenCV 설치 (NumPy 2.x 호환 버전)
pip install opencv-python==4.10.0.84
3. pyscreeze 수정(파이썬으로 실행할것)
import os
# pyscreeze 파일 경로
pyscreeze_file = r"D:\2.CODE\Python313\Lib\site-packages\pyscreeze\__init__.py"
# 파일 읽기
with open(pyscreeze_file, 'r', encoding='utf-8') as f:
content = f.read()
# 문제가 되는 라인 수정
content = content.replace(
"if not RUNNING_PYTHON_2 and cv2.__version__ < '3':",
"if not RUNNING_PYTHON_2 and hasattr(cv2, '__version__') and cv2.__version__ < '3':"
)
# 파일에 다시 쓰기
with open(pyscreeze_file, 'w', encoding='utf-8') as f:
f.write(content)
print("pyscreeze 파일이 수정되었습니다.")
최종 설치된 패키지 버전
주의사항
- Python 3.13 환경에서 실행
- NumPy 2.x와 호환되는 opencv-python 4.10.0.84 버전 사용
- pyscreeze 파일의 cv2.version 호출 부분을 수정해야 함
출처 : Cursor AI IDE(Auto모드)