본문 바로가기
Programing/AI

Jupyter notebook "500 : Internal Server Error" 오류 해결

by coMGod98 2023. 4. 2.

2023.03.31 - [AI] - [Windows] 텐서플로우(Tensorflow 2.x) GPU 딥러닝 개발환경 구축

 

[Windows] 텐서플로우(Tensorflow 2.x) GPU 딥러닝 개발환경 구축

PC 환경 확인 ● OS 본인 PC의 Winodws 버전을 확인합니다. 세 가지 방법 중에 하나로 확인할 수 있습니다. 1. 내 PC > 속성 2. 설정 > 시스템 > 정보 3. 제어판 > 시스템 ● GPU 모델 본인 PC의 GPU 사양을 확

toward-the-future.tistory.com

필자는 이전 글에서 tensorflow 2.10.0 버전과 python 3.10 버전을 설치했다. 필자의 경우 PyCharm IDE를 주로 사용하다보니 Jupyer notebook을 신경쓰지 않았었다. 

그러나! Jupyter notebook을 사용하려하니 "500 : Internal Server Error"와 함께 attributeerror: partially initialized module 'charset_normalizer' has no attribute 'md__mypyc' (most likely due to a circular import) 메시지가 발생했다. 이유를 찾지 못해서 검색을 통해서 해결하려고 노력했지만 빈번히 실패했다. Stack Overflow의 대부분 사람들은 jupyter notebook 혹은 nbconvert를 최신버전으로 업데이트하라는 내용이 대부분이었다. 

혹시 nbconvert의 버전이 무언가랑 버전의 호환이 맞지 않는 건가 해서 nbconvert documentation을 찾아서 헤맸다. https://github.com/jupyter/nbconvert

 

GitHub - jupyter/nbconvert: Jupyter Notebook Conversion

Jupyter Notebook Conversion. Contribute to jupyter/nbconvert development by creating an account on GitHub.

github.com

 

역시 버전 문제였다. nbconvert는 3.7~3.9 버전의 파이썬을 지원했다. 그래서 바로 python을 3.9버전으로 다운그레이드 한 후 jupyter notebook을 실행했다. 필자는 가상환경을 제거 후에 새로운 가상환경을 만들어줬다. (호환성이 중요한 패키지는 freeze로 저장해놓는게 좋다)

하지만 이번에도 "500 : Internal Server Error"라는 메시지와 함께 'ImportError: cannot import name 'contextfilter' from 'jinja2'가 발생 했다. 이번에는 Stack Overflow에서 말해준 방식으로 jupyter notebook과 nbconvert의 버전을 업그레이드하니 정상적으로 jupyter notebook을 사용할 수 있었다.

conda update jupyter
conda update nbconvert

댓글