python

matplotlib.pyplot import 오류

hellownd 2019. 6. 17. 20:30

import matplotlib.pyplot as plt error

오류 메시지

  • matplotlib.pyplot을 import 시 위 스크린샷과 같은 오류가 발생하는 경우가 있음
  • ValueError: _getFullpathname: embedded null character 오류

해결방법

  • 스크린샷의 오류 메시지 중 Anaconda3/lib/site-packages/matplotlib/font_manager.py의 아래 부분을 찾아서

    direc = os.path.abspath(direc).lower()
  • 아래 코드로 대치

    direc = direc.split('\0', 1)[0]