Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readline failed to install with python 3.6; use gnureadline #38

Open
ntkathole opened this issue Aug 7, 2021 · 2 comments
Open

readline failed to install with python 3.6; use gnureadline #38

ntkathole opened this issue Aug 7, 2021 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@ntkathole
Copy link
Contributor

Currently we are trying to install readline with python 3.6, which errors out with RHEL 8
https://github.com/RedHatQE/pylero/blob/master/requirements.txt#L4

Either use gnureadline or use readline for < python 3.6.

Environment:


(env) [cloud-user@nkathole-test pylero]$ cat /etc/redhat-release
Red Hat Enterprise Linux release 8.4 (Ootpa)
(env) [cloud-user@nkathole-test pylero]$ python --version
Python 3.6.8
(env) [cloud-user@nkathole-test pylero]$ pip --version
pip 21.2.3 from /home/cloud-user/pylero/env/lib64/python3.6/site-packages/pip (python 3.6)
(env) [cloud-user@nkathole-test pylero]$ gcc --version
gcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Error:

(env) [cloud-user@nkathole-test pylero]$ pip install -r requirements.txt
Ignoring suds: markers 'python_version < "3.0"' don't match your environment
Requirement already satisfied: suds-py3 in ./env/lib/python3.6/site-packages (from -r requirements.txt (line 2)) (1.4.4.1)
Requirement already satisfied: click in ./env/lib/python3.6/site-packages (from -r requirements.txt (line 3)) (8.0.1)
Collecting readline
  Using cached readline-6.2.4.1.tar.gz (2.3 MB)
Requirement already satisfied: importlib-metadata in ./env/lib/python3.6/site-packages (from click->-r requirements.txt (line 3)) (4.6.3)
Requirement already satisfied: typing-extensions>=3.6.4 in ./env/lib/python3.6/site-packages (from importlib-metadata->click->-r requirements.txt (line 3)) (3.10.0.0)
Requirement already satisfied: zipp>=0.5 in ./env/lib/python3.6/site-packages (from importlib-metadata->click->-r requirements.txt (line 3)) (3.5.0)
Using legacy 'setup.py install' for readline, since package 'wheel' is not installed.
Installing collected packages: readline
    Running setup.py install for readline ... error
    ERROR: Command errored out with exit status 1:
     command: /home/cloud-user/pylero/env/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_w_0o1no/readline_e5173cb7981f4efcba5ff6d28ea79768/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_w_0o1no/readline_e5173cb7981f4efcba5ff6d28ea79768/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-awgbuuml/install-record.txt --single-version-externally-managed --compile --install-headers /home/cloud-user/pylero/env/include/site/python3.6/readline
         cwd: /tmp/pip-install-_w_0o1no/readline_e5173cb7981f4efcba5ff6d28ea79768/
    Complete output (173 lines):

    ============ Building the readline library ============

    readline-6.2/
    readline-6.2/doc/
    readline-6.2/doc/Makefile.in
    readline-6.2/doc/texinfo.tex
    readline-6.2/doc/version.texi
    readline-6.2/doc/fdl.texi
    readline-6.2/doc/rlman.texi
    readline-6.2/doc/rltech.texi
    readline-6.2/doc/rluser.texi
    readline-6.2/doc/rluserman.texi
    readline-6.2/doc/history.texi
    readline-6.2/doc/hstech.texi
    readline-6.2/doc/hsuser.texi
    readline-6.2/doc/readline.3
    readline-6.2/doc/history.3
    readline-6.2/doc/texi2dvi
    readline-6.2/doc/texi2html
    readline-6.2/doc/readline.ps
    readline-6.2/doc/history.ps
    readline-6.2/doc/rluserman.ps
    readline-6.2/doc/readline.dvi
    readline-6.2/doc/history.dvi
    readline-6.2/doc/rluserman.dvi
    readline-6.2/doc/readline.info
    readline-6.2/doc/history.info
    readline-6.2/doc/rluserman.info
    readline-6.2/doc/readline.html
    readline-6.2/doc/history.html
    readline-6.2/doc/rluserman.html
    readline-6.2/doc/readline.0
    readline-6.2/doc/history.0
    readline-6.2/doc/readline_3.ps
    readline-6.2/doc/history_3.ps
    readline-6.2/doc/history.pdf
    readline-6.2/doc/readline.pdf
    readline-6.2/doc/rluserman.pdf
    readline-6.2/examples/
    readline-6.2/examples/autoconf/
    readline-6.2/examples/autoconf/BASH_CHECK_LIB_TERMCAP
    readline-6.2/examples/autoconf/RL_LIB_READLINE_VERSION
    readline-6.2/examples/autoconf/wi_LIB_READLINE
    readline-6.2/examples/rlfe/
    readline-6.2/examples/rlfe/ChangeLog
    readline-6.2/examples/rlfe/Makefile.in
    readline-6.2/examples/rlfe/README
    readline-6.2/examples/rlfe/config.h.in
    readline-6.2/examples/rlfe/configure
    readline-6.2/examples/rlfe/configure.in
    readline-6.2/examples/rlfe/extern.h
    readline-6.2/examples/rlfe/os.h
    readline-6.2/examples/rlfe/pty.c
    readline-6.2/examples/rlfe/rlfe.c
    readline-6.2/examples/rlfe/screen.h
    readline-6.2/examples/Makefile.in
    readline-6.2/examples/excallback.c
    readline-6.2/examples/fileman.c
    readline-6.2/examples/manexamp.c
    readline-6.2/examples/readlinebuf.h
    readline-6.2/examples/rl-fgets.c
    readline-6.2/examples/rlcat.c
    readline-6.2/examples/rlevent.c
    readline-6.2/examples/rltest.c
    readline-6.2/examples/rl.c
    readline-6.2/examples/rlptytest.c
    readline-6.2/examples/rlversion.c
    readline-6.2/examples/histexamp.c
    readline-6.2/examples/Inputrc
    readline-6.2/examples/rlwrap-0.30.tar.gz
    readline-6.2/support/
    readline-6.2/support/config.guess
    readline-6.2/support/config.rpath
    readline-6.2/support/config.sub
    readline-6.2/support/install.sh
    readline-6.2/support/mkdirs
    readline-6.2/support/mkdist
    readline-6.2/support/mkinstalldirs
    readline-6.2/support/shobj-conf
    readline-6.2/support/shlib-install
    readline-6.2/support/wcwidth.c
    readline-6.2/shlib/
    readline-6.2/shlib/Makefile.in
    readline-6.2/COPYING
    readline-6.2/README
    readline-6.2/MANIFEST
    readline-6.2/INSTALL
    readline-6.2/CHANGELOG
    readline-6.2/CHANGES
    readline-6.2/NEWS
    readline-6.2/USAGE
    readline-6.2/aclocal.m4
    readline-6.2/config.h.in
    readline-6.2/configure
    readline-6.2/configure.in
    readline-6.2/Makefile.in
    readline-6.2/ansi_stdlib.h
    readline-6.2/chardefs.h
    readline-6.2/history.h
    readline-6.2/histlib.h
    readline-6.2/keymaps.h
    readline-6.2/posixdir.h
    readline-6.2/posixjmp.h
    readline-6.2/readline.h
    readline-6.2/posixselect.h
    readline-6.2/posixstat.h
    readline-6.2/rlconf.h
    readline-6.2/rldefs.h
    readline-6.2/rlmbutil.h
    readline-6.2/rlprivate.h
    readline-6.2/rlshell.h
    readline-6.2/rlstdc.h
    readline-6.2/rltty.h
    readline-6.2/rltypedefs.h
    readline-6.2/rlwinsize.h
    readline-6.2/tcap.h
    readline-6.2/tilde.h
    readline-6.2/xmalloc.h
    readline-6.2/bind.c
    readline-6.2/callback.c
    readline-6.2/compat.c
    readline-6.2/complete.c
    readline-6.2/display.c
    readline-6.2/emacs_keymap.c
    readline-6.2/funmap.c
    readline-6.2/input.c
    readline-6.2/isearch.c
    readline-6.2/keymaps.c
    readline-6.2/kill.c
    readline-6.2/macro.c
    readline-6.2/mbutil.c
    readline-6.2/misc.c
    readline-6.2/nls.c
    readline-6.2/parens.c
    readline-6.2/readline.c
    readline-6.2/rltty.c
    readline-6.2/savestring.c
    readline-6.2/search.c
    readline-6.2/shell.c
    readline-6.2/signals.c
    readline-6.2/terminal.c
    readline-6.2/text.c
    readline-6.2/tilde.c
    readline-6.2/undo.c
    readline-6.2/util.c
    readline-6.2/vi_keymap.c
    readline-6.2/vi_mode.c
    readline-6.2/xfree.c
    readline-6.2/xmalloc.c
    readline-6.2/history.c
    readline-6.2/histexpand.c
    readline-6.2/histfile.c
    readline-6.2/histsearch.c
    readline-6.2/patchlevel
    ./build.sh: line 41: patch: command not found

    ============ Building the readline extension module ============

    running install
    running build
    running build_ext
    building 'readline' extension
    creating build
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/Modules
    creating build/temp.linux-x86_64-3.6/Modules/3.x
    gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_RL_CALLBACK -DHAVE_RL_CATCH_SIGNAL -DHAVE_RL_COMPLETION_APPEND_CHARACTER -DHAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK -DHAVE_RL_COMPLETION_MATCHES -DHAVE_RL_COMPLETION_SUPPRESS_APPEND -DHAVE_RL_PRE_INPUT_HOOK -I. -I/home/cloud-user/pylero/env/include -I/usr/include/python3.6m -c Modules/3.x/readline.c -o build/temp.linux-x86_64-3.6/Modules/3.x/readline.o -Wno-strict-prototypes
    Modules/3.x/readline.c:8:10: fatal error: Python.h: No such file or directory
     #include "Python.h"
              ^~~~~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/cloud-user/pylero/env/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_w_0o1no/readline_e5173cb7981f4efcba5ff6d28ea79768/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_w_0o1no/readline_e5173cb7981f4efcba5ff6d28ea79768/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-awgbuuml/install-record.txt --single-version-externally-managed --compile --install-headers /home/cloud-user/pylero/env/include/site/python3.6/readline Check the logs for full command output.
@leelavg
Copy link
Collaborator

leelavg commented Aug 7, 2021

@ntkathole thanks for the report.

  • This was creating issues from long back, but couldn't able to find a universal solution for this
  • Consider below (more of a python issue rather than RHEL):
  1. readline is deprecated in favour of gnureadline
  2. Both of these need python devel package
  3. If you install readline from python v3.7, it prints stack trace on some machines (~fedora)
  4. But some machines already have readline or gnureadline installed and in those we shouldn't mandate to use only one
  5. Either of these is needed only if we start interpreter with pylero command in which it'll load all necessary modules.

Gist is, we are happy to get a contribution or some tested methodology for a generic solution.

@leelavg
Copy link
Collaborator

leelavg commented Aug 7, 2021

Btw, if you are currently blocked, pls install python3-devel pkg which provide header file and you'll be good to go.

@leelavg leelavg added the help wanted Extra attention is needed label Mar 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants