Python/Python 개발환경

해결방법 ValueError: No template sub-directory with name ‘script’ found in the following paths

webnautes 2023. 10. 7. 06:29
반응형

MacBook에서 ipynb를 py로 변환시 발생한 다음 에러를 해결한 방법입니다.

ValueError: No template sub-directory with name ‘script’ found in the following paths

 

2023. 9. 24 최초작성



MacBook에서 주피터 노트북 파일 ipynb을 파이썬 코드 파일 py로 바꾸려고 했는데 에러가 발생했습니다.

 

% jupyter nbconvert --to script faiss.ipynb   

....  

ValueError: No template sub-directory with name 'script' found in the following paths:
        /Users/webnautes/Library/Jupyter
        /Users/webnautes/Library/Python/3.9/share/jupyter
        /opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/share/jupyter
        /usr/local/share/jupyter
        /usr/share/jupyter



다음처럼 링크를 추가해준 후 해결이 되었습니다.

ln -s /opt/homebrew/share/jupyter/nbconvert ~/Library/Jupyter



문제없이 ipynb 파일이 py파일로 변환되었습니다.

% jupyter nbconvert --to script faiss.ipynb                   

[NbConvertApp] Converting notebook faiss.ipynb to script

[NbConvertApp] Writing 2961 bytes to faiss.py


반응형