You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 20.04下Apache Age安装报错:pip无法匹配对应版本

解决pip安装apache-age找不到版本的问题

问题原因

PyPI上无名为apache-age的官方包,直接用pip install apache-age会匹配失败;同时旧版pip可能存在索引同步问题,加剧该错误。

解决步骤

1. 升级pip至最新版本

旧版pip可能无法识别新包索引,先执行升级:

pip install --upgrade pip

2. 从源码安装Apache Age Python客户端

Apache Age的Python客户端需从官方源码仓库安装:

  • 克隆源码仓库:
    git clone https://github.com/apache/age-python.git
    
  • 进入仓库目录:
    cd age-python
    
  • 安装依赖:
    pip install -r requirements.txt
    
  • 完成客户端安装:
    pip install .
    

3. 验证并修复Apache Arrow版本

确保Apache Arrow版本≥3.0.0,执行以下命令查看版本:

pkg-config --modversion arrow

若版本不足,添加官方源安装指定版本:

sudo apt update
sudo apt install -y apt-transport-https ca-certificates gnupg
wget -qO- https://packages.apache.org/KEYS | sudo apt-key add -
echo "deb [arch=amd64] https://dl.bintray.com/apache/arrow/debian focal main" | sudo tee /etc/apt/sources.list.d/arrow.list
echo "deb-src [arch=amd64] https://dl.bintray.com/apache/arrow/debian focal main" | sudo tee -a /etc/apt/sources.list.d/arrow.list
sudo apt update
sudo apt install -y libarrow-dev=3.0.0-1

4. 确认PostgreSQL的Age扩展已正确部署

Python客户端依赖PostgreSQL的Age扩展,需确保已按官方文档完成扩展的编译、安装,且目标数据库已加载该扩展。

内容的提问来源于stack exchange,提问作者Mahina Sheikh

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.23 07:07:31