pyenv icon indicating copy to clipboard operation
pyenv copied to clipboard

`_curses` fails to build on Ubuntu 22

Open samling opened this issue 11 months ago • 2 comments

Platform: Ubuntu 22.04 OS architecture: amd64 Pyenv version: 2.3.36 Python version: 3.10.x C Compiler information: gcc 11.4.0

I'm installing python 3.10.x (I've tried 3.10.12 and 3.10.14) on a more or less fresh Ubuntu 22 machine. Initially I hit the expected dependency errors detailed here, and installing the listed packages got around all but one of the errors.

The problem is that _curses fails to build, and so the installation eventually throws an error when trying to import it. I've attached the build logs and debug output.

Some relevant snippets:

Checking to make sure libncurses packages are installed (I initially tried the recommended libncursesw5 before trying the libncurses5 fallback):

❯ sudo apt-get install libncurses5 libncurses5-dev libncursesw5 libncursesw5-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libncurses5-dev is already the newest version (6.3-2ubuntu0.1).
libncursesw5-dev is already the newest version (6.3-2ubuntu0.1).
libncurses5 is already the newest version (6.3-2ubuntu0.1).
libncursesw5 is already the newest version (6.3-2ubuntu0.1).

From the build debug output:

checking curses.h usability... yes
checking curses.h presence... yes
checking for curses.h... yes
checking ncurses.h usability... yes
checking ncurses.h presence... yes
checking for ncurses.h... yes
building '_curses' extension

Errors thrown during installation when attempting to build _curses:

building '_curses' extension
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I/home/sboynton/.pyenv/versions/3.10.14/include -fPIC -DHAVE_NCURSESW=1 -I/usr/include/ncursesw -I./Include -I. -I/home/sboynton/.pyenv/versions/3.10.14/include -I/usr/include/x86_64-linux-gnu -I/usr/local/include -I/tmp/python-build.20240322105256.549130/Python-3.10.14/Include -I/tmp/python-build.20240322105256.549130/Python-3.10.14 -c /tmp/python-build.20240322105256.549130/Python-3.10.14/Modules/_cursesmodule.c -o build/temp.linux-x86_64-3.10/tmp/python-build.20240322105256.549130/Python-3.10.14/Modules/_cursesmodule.o -DPy_BUILD_CORE_MODULE
/tmp/python-build.20240322105256.549130/Python-3.10.14/Modules/_cursesmodule.c: In function ‘_curses_window_addch_impl’:
/tmp/python-build.20240322105256.549130/Python-3.10.14/Modules/_cursesmodule.c:760:9: error: implicit declaration of function ‘setcchar’; did you mean ‘getwchar’? [-Werror=implicit-function-declaration]
/tmp/python-build.20240322105256.549130/Python-3.10.14/Modules/_cursesmodule.c:762:19: error: implicit declaration of function ‘mvwadd_wch’; did you mean ‘mvwaddch’? [-Werror=implicit-function-declaration]
/tmp/python-build.20240322105256.549130/Python-3.10.14/Modules/_cursesmodule.c:764:19: error: implicit declaration of function ‘wadd_wch’; did you mean ‘waddch’? [-Werror=implicit-function-declaration]
/tmp/python-build.20240322105256.549130/Python-3.10.14/Modules/_cursesmodule.c: In function ‘_curses_window_addstr_impl’:

I appreciate any and all support. Apologies if this has been addressed somewhere else already, I searched up and down and couldn't find anything that quite matched this issue.

trace.log python-build.20240322105256.549130.log

samling avatar Mar 22 '24 18:03 samling