python 安装readline 报错:gcc: error: readline/libreadline.a: No such file or directory

[root@localhost Python-3.6.4]# pip3.6 install readline

creating build/lib.linux-x86_64-3.6
gcc -pthread -shared build/temp.linux-x86_64-3.6/Modules/3.x/readline.o readline/libreadline.a readline/libhistory.a -lncurses -o build/lib.linux-x86_64-3.6/readline.cpython-36m-x86_64-linux-gnu.so
gcc: error: readline/libreadline.a: No such file or directory
gcc: error: readline/libhistory.a: No such file or directory
error: command 'gcc' failed with exit status 1

解决办法:
[root@localhost Python-3.6.4]# yum -y install patch readline-devel

[root@localhost Python-3.6.4]# pip3.6 install readline
Collecting readline
Using cached https://files.pythonhosted.org/packages/f4/01/2cf081af8d880b44939a5f1b446551a7f8d59eae414277fd0c303757ff1b/readline-6.2.4.1.tar.gz
Installing collected packages: readline
Running setup.py install for readline … done
Successfully installed readline-6.2.4.1
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the ‘pip install –upgrade pip’ command.

猜你喜欢

转载自blog.csdn.net/q936889811/article/details/80631766