Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Centos Linux上,如何安装Python软件包';readline';使用pip?_Python_Installation_Centos_Pip_Readline - Fatal编程技术网

在Centos Linux上,如何安装Python软件包';readline';使用pip?

在Centos Linux上,如何安装Python软件包';readline';使用pip?,python,installation,centos,pip,readline,Python,Installation,Centos,Pip,Readline,使用常规命令sudo pip install readline我遇到了一个错误 Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-Ax57Qh/readline/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec')

使用常规命令
sudo pip install readline
我遇到了一个错误

Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-Ax57Qh/readline/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-KRvGg7-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-Ax57Qh/readline
完整的控制台输出是

sudo pip install readline
[sudo] password for qazwsx:
Collecting readline
  Using cached readline-6.2.4.1.tar.gz
Installing collected packages: readline
  Running setup.py install for readline
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-Ax57Qh/readline/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-KRvGg7-record/install-record.txt --single-version-externally-managed --compile:
    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
    patching file vi_mode.c
    patching file callback.c
    patching file support/shobj-conf
    patching file patchlevel
    patching file input.c
    patching file patchlevel
    patching file vi_mode.c
    patching file patchlevel
    checking build system type... x86_64-unknown-linux-gnu
    checking host system type... x86_64-unknown-linux-gnu

    Beginning configuration for readline-6.2 for x86_64-unknown-linux-gnu

    checking whether make sets $(MAKE)... yes
    checking for gcc... gcc
    checking for C compiler default output file name... a.out
    checking whether the C compiler works... yes
    checking whether we are cross compiling... no
    checking for suffix of executables...
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking how to run the C preprocessor... gcc -E
    checking for grep that handles long lines and -e... /usr/bin/grep
    checking for egrep... /usr/bin/grep -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking minix/config.h usability... no
    checking minix/config.h presence... no
    checking for minix/config.h... no
    checking whether it is safe to define __EXTENSIONS__... yes
    checking whether gcc needs -traditional... no
    checking for a BSD-compatible install... /usr/bin/install -c
    checking for ar... ar
    checking for ranlib... ranlib
    checking for an ANSI C-conforming const... yes
    checking for function prototypes... yes
    checking whether char is unsigned... no
    checking for working volatile... yes
    checking return type of signal handlers... void
    checking for size_t... yes
    checking for ssize_t... yes
    checking for ANSI C header files... (cached) yes
    checking whether stat file-mode macros are broken... no
    checking for dirent.h that defines DIR... yes
    checking for library containing opendir... none required
    checking for fcntl... yes
    checking for kill... yes
    checking for lstat... yes
    checking for memmove... yes
    checking for putenv... yes
    checking for select... yes
    checking for setenv... yes
    checking for setlocale... yes
    checking for strcasecmp... yes
    checking for strpbrk... yes
    checking for tcgetattr... yes
    checking for vsnprintf... yes
    checking for isascii... yes
    checking for isxdigit... yes
    checking for getpwent... yes
    checking for getpwnam... yes
    checking for getpwuid... yes
    checking for working strcoll... yes
    checking fcntl.h usability... yes
    checking fcntl.h presence... yes
    checking for fcntl.h... yes
    checking for unistd.h... (cached) yes
    checking for stdlib.h... (cached) yes
    checking varargs.h usability... no
    checking varargs.h presence... no
    checking for varargs.h... no
    checking stdarg.h usability... yes
    checking stdarg.h presence... yes
    checking for stdarg.h... yes
    checking for string.h... (cached) yes
    checking for strings.h... (cached) yes
    checking limits.h usability... yes
    checking limits.h presence... yes
    checking for limits.h... yes
    checking locale.h usability... yes
    checking locale.h presence... yes
    checking for locale.h... yes
    checking pwd.h usability... yes
    checking pwd.h presence... yes
    checking for pwd.h... yes
    checking for memory.h... (cached) yes
    checking termcap.h usability... no
    checking termcap.h presence... no
    checking for termcap.h... no
    checking termios.h usability... yes
    checking termios.h presence... yes
    checking for termios.h... yes
    checking termio.h usability... yes
    checking termio.h presence... yes
    checking for termio.h... yes
    checking sys/pte.h usability... no
    checking sys/pte.h presence... no
    checking for sys/pte.h... no
    checking sys/stream.h usability... no
    checking sys/stream.h presence... no
    checking for sys/stream.h... no
    checking sys/select.h usability... yes
    checking sys/select.h presence... yes
    checking for sys/select.h... yes
    checking sys/file.h usability... yes
    checking sys/file.h presence... yes
    checking for sys/file.h... yes
    checking for sys/ptem.h... no
    checking for special C compiler options needed for large files... no
    checking for _FILE_OFFSET_BITS value needed for large files... no
    checking for type of signal functions... posix
    checking if signal handlers must be reinstalled when invoked... no
    checking for presence of POSIX-style sigsetjmp/siglongjmp... present
    checking for lstat... yes
    checking whether or not strcoll and strcmp differ... no
    checking whether the ctype macros accept non-ascii characters... yes
    checking whether getpw functions are declared in pwd.h... yes
    checking whether termios.h defines TIOCGWINSZ... no
    checking whether sys/ioctl.h defines TIOCGWINSZ... yes
    checking for sig_atomic_t in signal.h... yes
    checking whether signal handlers are of type void... yes
    checking for TIOCSTAT in sys/ioctl.h... no
    checking for FIONREAD in sys/ioctl.h... yes
    checking for speed_t in sys/types.h... no
    checking for struct winsize in sys/ioctl.h and termios.h... sys/ioctl.h
    checking for struct dirent.d_ino... yes
    checking for struct dirent.d_fileno... yes
    checking for tgetent... no
    checking for tgetent in -ltermcap... no
    checking for tgetent in -ltinfo... no
    checking for tgetent in -lcurses... no
    checking for tgetent in -lncurses... no
    checking which library has the termcap functions... using gnutermcap
    checking wctype.h usability... yes
    checking wctype.h presence... yes
    checking for wctype.h... yes
    checking wchar.h usability... yes
    checking wchar.h presence... yes
    checking for wchar.h... yes
    checking langinfo.h usability... yes
    checking langinfo.h presence... yes
    checking for langinfo.h... yes
    checking for mbrlen... yes
    checking for mbscasecmp... no
    checking for mbscmp... no
    checking for mbsnrtowcs... yes
    checking for mbsrtowcs... yes
    checking for mbschr... no
    checking for wcrtomb... yes
    checking for wcscoll... yes
    checking for wcsdup... yes
    checking for wcwidth... yes
    checking for wctype... yes
    checking for wcswidth... yes
    checking whether mbrtowc and mbstate_t are properly declared... yes
    checking for iswlower... yes
    checking for iswupper... yes
    checking for towlower... yes
    checking for towupper... yes
    checking for iswctype... yes
    checking for nl_langinfo and CODESET... yes
    checking for wchar_t in wchar.h... yes
    checking for wctype_t in wctype.h... yes
    checking for wint_t in wctype.h... yes
    checking configuration for building shared libraries... supported
    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating doc/Makefile
    config.status: creating examples/Makefile
    config.status: creating shlib/Makefile
    config.status: creating config.h
    config.status: executing default commands
    rm -f readline.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O readline.c
    rm -f vi_mode.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O vi_mode.c
    rm -f funmap.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O funmap.c
    rm -f keymaps.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O keymaps.c
    rm -f parens.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O parens.c
    rm -f search.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O search.c
    rm -f rltty.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O rltty.c
    rm -f complete.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O complete.c
    rm -f bind.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O bind.c
    rm -f isearch.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O isearch.c
    rm -f display.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O display.c
    rm -f signals.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O signals.c
    rm -f util.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O util.c
    rm -f kill.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O kill.c
    rm -f undo.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O undo.c
    rm -f macro.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O macro.c
    rm -f input.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O input.c
    rm -f callback.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O callback.c
    rm -f terminal.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O terminal.c
    rm -f text.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O text.c
    rm -f nls.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O nls.c
    rm -f misc.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O misc.c
    rm -f compat.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O compat.c
    rm -f xfree.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O xfree.c
    rm -f xmalloc.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O xmalloc.c
    rm -f history.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O history.c
    rm -f histexpand.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O histexpand.c
    rm -f histfile.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O histfile.c
    rm -f histsearch.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O histsearch.c
    rm -f shell.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O shell.c
    rm -f mbutil.o
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O mbutil.c
    rm -f tilde.o
    gcc -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -g -O -DREADLINE_LIBRARY -c ./tilde.c
    rm -f libreadline.a
    ar cr libreadline.a readline.o vi_mode.o funmap.o keymaps.o parens.o search.o rltty.o complete.o bind.o isearch.o display.o signals.o util.o kill.o undo.o macro.o input.o callback.o terminal.o text.o nls.o misc.o compat.o xfree.o xmalloc.o history.o histexpand.o histfile.o histsearch.o shell.o mbutil.o tilde.o
    test -n "ranlib" && ranlib libreadline.a
    rm -f libhistory.a
    ar cr libhistory.a history.o histexpand.o histfile.o histsearch.o shell.o mbutil.o xmalloc.o xfree.o
    test -n "ranlib" && ranlib libhistory.a
    test -d shlib || mkdir shlib
    ( cd shlib ; make  all )
    make[1]: Entering directory `/tmp/pip-build-Ax57Qh/readline/rl/readline-lib/shlib'
    rm -f readline.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o readline.o ../readline.c
    mv readline.o readline.so
    rm -f vi_mode.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o vi_mode.o ../vi_mode.c
    mv vi_mode.o vi_mode.so
    rm -f funmap.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o funmap.o ../funmap.c
    mv funmap.o funmap.so
    rm -f keymaps.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o keymaps.o ../keymaps.c
    mv keymaps.o keymaps.so
    rm -f parens.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o parens.o ../parens.c
    mv parens.o parens.so
    rm -f search.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o search.o ../search.c
    mv search.o search.so
    rm -f rltty.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o rltty.o ../rltty.c
    mv rltty.o rltty.so
    rm -f complete.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o complete.o ../complete.c
    mv complete.o complete.so
    rm -f bind.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o bind.o ../bind.c
    mv bind.o bind.so
    rm -f isearch.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o isearch.o ../isearch.c
    mv isearch.o isearch.so
    rm -f display.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o display.o ../display.c
    mv display.o display.so
    rm -f signals.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o signals.o ../signals.c
    mv signals.o signals.so
    rm -f util.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o util.o ../util.c
    mv util.o util.so
    rm -f kill.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o kill.o ../kill.c
    mv kill.o kill.so
    rm -f undo.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o undo.o ../undo.c
    mv undo.o undo.so
    rm -f macro.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o macro.o ../macro.c
    mv macro.o macro.so
    rm -f input.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o input.o ../input.c
    mv input.o input.so
    rm -f callback.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o callback.o ../callback.c
    mv callback.o callback.so
    rm -f terminal.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o terminal.o ../terminal.c
    mv terminal.o terminal.so
    rm -f text.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o text.o ../text.c
    mv text.o text.so
    rm -f nls.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o nls.o ../nls.c
    mv nls.o nls.so
    rm -f misc.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o misc.o ../misc.c
    mv misc.o misc.so
    rm -f xmalloc.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o xmalloc.o ../xmalloc.c
    mv xmalloc.o xmalloc.so
    rm -f xfree.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o xfree.o ../xfree.c
    mv xfree.o xfree.so
    rm -f history.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o history.o ../history.c
    mv history.o history.so
    rm -f histexpand.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o histexpand.o ../histexpand.c
    mv histexpand.o histexpand.so
    rm -f histfile.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o histfile.o ../histfile.c
    mv histfile.o histfile.so
    rm -f histsearch.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o histsearch.o ../histsearch.c
    mv histsearch.o histsearch.so
    rm -f shell.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o shell.o ../shell.c
    mv shell.o shell.so
    rm -f mbutil.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o mbutil.o ../mbutil.c
    mv mbutil.o mbutil.so
    rm -f tilde.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -DREADLINE_LIBRARY -c -o tilde.o ../tilde.c
    mv tilde.o tilde.so
    rm -f compat.so
    gcc -c -DHAVE_CONFIG_H   -DNEED_EXTERN_PC -fPIC -I. -I.. -I.. -DRL_LIBRARY_VERSION='"6.2"' -g -O -fPIC -o compat.o ../compat.c
    mv compat.o compat.so
    rm -f libreadline.so.6.2
    gcc -shared -Wl,-soname,libreadline.so.6.2 -L./lib/termcap -Wl,-rpath,/usr/local/lib -Wl,-soname,`basename libreadline.so.6.2 .2` -o libreadline.so.6.2 readline.so vi_mode.so funmap.so keymaps.so parens.so search.so rltty.so complete.so bind.so isearch.so display.so signals.so util.so kill.so undo.so macro.so input.so callback.so terminal.so text.so nls.so misc.so xmalloc.so xfree.so history.so histexpand.so histfile.so histsearch.so shell.so mbutil.so tilde.so compat.so
    rm -f libhistory.so.6.2
    gcc -shared -Wl,-soname,libhistory.so.6.2 -L./lib/termcap -Wl,-rpath,/usr/local/lib -Wl,-soname,`basename libhistory.so.6.2 .2` -o libhistory.so.6.2 history.so histexpand.so histfile.so histsearch.so shell.so mbutil.so xmalloc.so xfree.so
    make[1]: Leaving directory `/tmp/pip-build-Ax57Qh/readline/rl/readline-lib/shlib'

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


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

    running install
    running build
    running build_ext
    building 'readline' extension
    creating build
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/Modules
    creating build/temp.linux-x86_64-2.7/Modules/2.x
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -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/usr/include/python2.7 -c Modules/2.x/readline.c -o build/temp.linux-x86_64-2.7/Modules/2.x/readline.o -Wno-strict-prototypes
    Modules/2.x/readline.c:8:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-Ax57Qh/readline/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-KRvGg7-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-Ax57Qh/readline
更新:将路径添加到
$CPATH
没有帮助

-bash-4.2$ locate Python.h
/usr/include/python2.7/Python.h
-bash-4.2$ echo $CPATH

-bash-4.2$ export CPATH=/usr/include/python2.7/
-bash-4.2$ echo $CPATH
/usr/include/python2.7/
运行
sudo pip install readline
,我仍然会遇到相同的错误:

Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-NP1WUS/readline/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-9Uamrv-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-NP1WUS/readline
那么,所述文件在tmp/中不再存在:

-bash-4.2$ ls -la /tmp/pip-build-*
ls: cannot access /tmp/pip-build-*: No such file or directory

不确定,但:


尝试安装
sudo-yum-install-python-devel

编辑:
能否检查/usr/include/python2.7目录是否确实存在?gcc似乎找不到Python的库。

不确定,但:


尝试安装
sudo-yum-install-python-devel

编辑:
能否检查/usr/include/python2.7目录是否确实存在?gcc似乎找不到Python的库。

不确定,但:


尝试安装
sudo-yum-install-python-devel

编辑:
能否检查/usr/include/python2.7目录是否确实存在?gcc似乎找不到Python的库。

不确定,但:


尝试安装
sudo-yum-install-python-devel

编辑:
能否检查/usr/include/python2.7目录是否确实存在?看起来gcc找不到Python的库。

这实际上是一个Linux/gcc问题,而不是Python/pip问题。此外,如果你看一下输出,你的问题越紧凑越好。文本墙的末端才是最重要的

当pip完成配置步骤并开始编译时,安装失败。编译器找不到
Python.h
文件,该文件是包含插件源代码将使用的大量定义的头文件

失败的长gcc命令添加了此标志
-I/usr/include/python2.7

您可以首先查看该路径是否存在,以及它是否包含python头。在我的系统上,由于各种原因,我安装了一整套python版本,但通常我的环境是这样配置的:环境变量
$CPATH
将具有
/usr/python/active/include
,其中active是指向正确版本的链接。因此,如果我使用的是python2.7,则指向
/usr/local/python/2.7/include

根据GCC关于环境变量的文件:

CPATH

C_包含_路径

CPLUS\u INCLUDE\u路径

OBJC_包含_路径

每个变量的值是一个目录列表,由一个特殊字符分隔,很像PATH,在其中查找头文件。特殊字符PATH_SEPARATOR依赖于目标并在GCC构建时确定。对于基于Microsoft Windows的目标,它是分号,而对于几乎所有其他目标,它是冒号

CPATH指定要搜索的目录列表,就像用-I指定一样,但在命令行上用-I选项指定的任何路径之后。无论预处理的是哪种语言,都将使用此环境变量

您可以通过首先定位相关文件所在的目录来解决此问题。尝试查找python可执行文件
,如果
../bin
之前的路径包含
/pythonXX/
文件夹,则该python
将指向以下内容
/some/path/../bin/pythonXX
,如果路径不包含,则标题应位于
/path/to/pythonXX/include
文件夹中
/some/path/../include/python/include

它可以根据安装的python版本的不同而有所不同,如果您在个人工作站或更大的集群上工作,或者您的系统管理员(或设置系统时的管理员)的偏好/做法而有所不同。无论哪种方法,如果找不到它,请尝试
locate Python.h

找到文件后,只需将其添加到CPATH变量中,然后重试

export CPATH=/the/path/to/this/file:$CPATH

然后再试一次。此问题将在下次尝试时发生,因此您可能希望将该行(不导出)添加到.bashrc文件中

这实际上是一个Linux/gcc问题,而不是python/pip问题。此外,如果你看一下输出,你的问题越紧凑越好。文本墙的末端才是最重要的

当pip完成配置步骤并开始编译时,安装失败。编译器找不到
Python.h
文件,该文件是包含插件源代码将使用的大量定义的头文件

失败的长gcc命令添加了此标志
-I/usr/include/python2.7

您可以首先查看该路径是否存在,以及它是否包含python头。在我的系统上,由于各种原因,我安装了一整套python版本,但通常我的环境是这样配置的:环境变量
$CPATH
将具有
/usr/python/active/include
,其中active是指向正确版本的链接。因此,如果我使用的是python2.7,则指向
/usr/local/python/2.7/include

根据GCC关于环境变量的文件:

CPATH

C_包含_路径

CPLUS\u INCLUDE\u路径

OBJC_包含_路径

每个变量的值是一个目录列表,由一个特殊字符分隔,很像PATH,在其中查找头文件。特殊字符PATH_SEPARATOR依赖于目标并在GCC构建时确定。对于基于Microsoft Windows的目标,它是分号,而对于几乎所有其他目标,它是冒号

CPATH指定要搜索的目录列表,就像用-I指定一样,但在命令行上用-I选项指定的任何路径之后。无论预处理的是哪种语言,都将使用此环境变量

您可以通过首先定位相关文件所在的目录来解决此问题。尝试查找python执行程序