[cv2] AttributeError: partially initialized module 'cv2' has no attribute 'gapi_wip_gst_GStreamerPipeline' (most likely due to a circular import) 오류 해결

es.Seong·2024년 11월 15일
0

삽질정리

목록 보기
1/5
post-thumbnail

Python : 3.8.10

오류 상황

특정 라이브러리 import 시 아래 에러로그가 출력되며 오류가 발생했다.

AttributeError: partially initialized module 'cv2' has no attribute 'gapi_wip_gst_GStreamerPipeline' (most likely due to a circular import)

원인

https://github.com/Rudrabha/Wav2Lip/issues/387

이 문제의 원인은 opencv의 버전 관련 이슈였다.
우선 개발환경에 설치된 cv관련 라이브러리 버전을 확인해봤다.

pip list |grep cv

버전을 확인해보니 opencv의 각 버전은 다음과 같았다.

해결

해결방법은 opencv-python-headless의 버전을 4.3 미만으로 낮추는 것이다.
명령어는 아래 명령어를 사용했다.

pip install "opencv-python-headless<4.3"

profile
Graduate student at Pusan National University, majoring in Artificial Intelligence

0개의 댓글

관련 채용 정보