在python3.4.3解释器中,我的左/右键是打印字符

时间:2015-08-13 00:47:55

标签: python fedora

我刚刚在目录make altinstall中使用/usr/src安装了python3.4.3,现在当我运行它的解释器时,我的左/右方向键正在打印字符。

[sinux1@horrible-host Python-3.4.3]$ python3.4
Python 3.4.3 (default, Aug 12 2015, 16:41:43) 
[GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print '(^[[D

在我的其他任何python安装(2.7.10和3.4.2)中都没有这样做 我在某处读到了我需要使用pip安装readline,但是当我运行它时,它说错了

Modules/2.x/readline.c:8:20: fatal error: Python.h: No such file or directory
    compilation terminated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-YfpoEt/readline/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-be3h4X-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-YfpoEt/readline

我被告知安装python-develpython3-devel,所以我做了,现在pip install readline抛弃了我

    ============ 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 -Werror=format-security -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 -Werror=format-security -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
    creating build/lib.linux-x86_64-2.7
    gcc -pthread -shared -Wl,-z,relro build/temp.linux-x86_64-2.7/Modules/2.x/readline.o readline/libreadline.a readline/libhistory.a -L/usr/lib64 -lncurses -lpython2.7 -o build/lib.linux-x86_64-2.7/readline.so
    /bin/ld: cannot find -lncurses
    collect2: error: ld returned 1 exit status
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-H7qRo6/readline/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-MzFZpO-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-H7qRo6/readline

有人知道发生了什么吗?我在Fedora22上

1 个答案:

答案 0 :(得分:0)

你安装了libncurses吗?

yum install ncurses-devel

或者

yum install ncurses-static