아래와 같은 에러 로그:
$ bitbake hello -f
FATAL: The knotty ui could not load the required curses python module.
python3-curses도 설치를 못함:
$ sudo apt-get install python3-curses Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package python3-curses
curses가 포트됐는지 확인:
$ python3 -c "import curses; print('curses OK')"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/mike.seo/.pyenv/versions/3.9.6/lib/python3.9/curses/__init__.py", line 13, in <module>
from _curses import *
ImportError: libncursesw.so.5: cannot open shared object file: No such file or directory
1. libncurses5 호환 패키지 설치
Ubuntu 22.04에는 아직 호환 라이브러리(libncurses5) 가 제공됩니다:
$ sudo apt-get install libncurses5
이렇게 하면 libncursesw.so.5 파일이 설치되어, pyenv로 설치한 Python 3.9.6이 curses 모듈을 불러올 수 있습니다.
2. pyenv Python을 ncurses6으로 재빌드 (권장)
더 깔끔한 방법은 Python을 현재 시스템의 libncurses6과 다시 빌드하는 것입니다:
$ sudo apt-get install libncurses5-dev libncursesw5-dev
$ pyenv install 3.9.6 --force
이렇게 하면 Python이 _curses 모듈을 새로 빌드하면서 libncursesw.so.6과 링크하게 됩니다.
3. 시스템 기본 Python 3.10 사용 (가장 간단함)
Ubuntu 22.04에는 기본적으로 Python 3.10이 설치되어 있고, 이 버전은 이미 curses 모듈이 정상 동작합니다. 따라서 BitBake를 실행할 때 시스템 Python을 그대로 사용하면 됩니다:
python3 -c "import curses; print('curses OK')"
summary
bitbake hello -f
WARNING: Layer mylayer should set LAYERSERIES_COMPAT_mylayer in its conf/layer.conf file to list the core layer names it is compatible with.
WARNING: Layer mylayer should set LAYERSERIES_COMPAT_mylayer in its conf/layer.conf file to list the core layer names it is compatible with.
Parsing recipes: 100% |#############################################################| Time: 0:00:00
Parsing of 1 .bb files complete (0 cached, 1 parsed). 1 targets, 0 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |##########################################################| Time: 0:00:00
NOTE: No setscene tasks
NOTE: Executing Tasks
WARNING: None do_build: Hello! bitbake world!
NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and all succeeded.
Summary: There were 3 WARNING messages shown.
FATAL: The knotty ui could not load the required curses python module.
2025. 9. 11. 16:51