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

本文介绍了解决在Python环境中安装readline模块时遇到的错误的方法。通过安装readline-devel包并重新尝试安装readline模块,成功解决了gcc找不到所需库文件的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

[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.

docker build -t gdal-python:3.13 . Sending build context to Docker daemon 1.052GB Step 1/7 : FROM python3.13:v1 as python_builder ---> e89b7d3211ea Step 2/7 : RUN tar cf /usr_local.tar /usr/local ---> Running in 63a4a91ffc7b tar: Removing leading `/' from member names Removing intermediate container 63a4a91ffc7b ---> ab2f23058ebc Step 3/7 : FROM ids:latest ---> e8f8ac2879c6 Step 4/7 : COPY --from=python_builder /usr_local.tar / ---> 3f04634e9582 Step 5/7 : RUN tar xf /usr_local.tar -C / && rm /usr_local.tar ---> Running in 9b995f9b7f81 Removing intermediate container 9b995f9b7f81 ---> bcf71786a84c Step 6/7 : ENV PATH="/usr/local/bin:${PATH}" ---> Running in 32708b1eb1de Removing intermediate container 32708b1eb1de ---> af14a4ede536 Step 7/7 : RUN python --version ---> Running in 29beba0e2cd5 python: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by python) python: /lib64/libm.so.6: version `GLIBC_2.35' not found (required by /usr/local/bin/../lib/libpython3.13.so.1.0) python: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/bin/../lib/libpython3.13.so.1.0) python: /lib64/libc.so.6: version `GLIBC_2.33' not found (required by /usr/local/bin/../lib/libpython3.13.so.1.0) python: /lib64/libc.so.6: version `GLIBC_2.32' not found (required by /usr/local/bin/../lib/libpython3.13.so.1.0) python: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by /usr/local/bin/../lib/libpython3.13.so.1.0) The command '/bin/sh -c python --version' returned a non-zero code: 1
最新发布
07-16
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值