main
[PyInstaller] ImportError: cannot import name 'MarkdownExporter' from 'nbconvert' 본문
Python
[PyInstaller] ImportError: cannot import name 'MarkdownExporter' from 'nbconvert'
1984 2023. 6. 22. 23:32에러
"dataframe_image" 패키지를 사용하는 프로젝트를 PyInstaller 로 빌드하여, exe 파일을 실행시키면 "nbconvert" 모듈의 Import Error 발생
ImportError: cannot import name 'MarkdownExporter' from 'nbconvert'
해결 방법
1. nbconvert를 6.4.3 버전으로 다운그레이드
pip install nbconvert==6.4.3
2. dataframe_image 디렉토리를 찾을 수 없다는 에러 발생
FileNotFoundError: [Errno 2] No such file or directory: 'D:\\code\\python\\...\\dist\\...\\dataframe_image\\static\\style.css'
3. .spec 파일의 datas에 dataframe_image 폴더 추가
.spec 파일은 pyinstaller를 한번 실행시키면 생성됨.
.conda 및 가상환경 폴더 경로 확인하여 설정해준다.
datas=[(r"C:\path\.conda\envs\env\Lib\site-packages\dataframe_image\static\style.css", r"dataframe_image\static")],
4. 수정한 .spec 파일로 pyinstaller 재실행
pyinstaller example.py
끝
참고자료
- 비슷한 에러
https://github.com/orgs/pyinstaller/discussions/6432
728x90
'Python' 카테고리의 다른 글
[Python] 숫자 -> 한글로 변환 (0) | 2023.09.13 |
---|---|
[Django] 프로젝트 내부에 App 만들기 (0) | 2023.04.28 |
[Django] Django 설치 및 프로젝트 생성 (Python 3.10 / Django 4.2) (0) | 2023.04.28 |
[Python] Python3 설치하기 (v 3.8.5) (0) | 2022.09.27 |
[Python] - 웹 크롤링 (selenium/beautifulsoup4 예제) (0) | 2022.09.02 |
Comments