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

Lubuntu22.04下Python3.10.6导入pandas报Illegal instruction (core dumped)求助

解决pandas导入报"Illegal instruction (core dumped)"问题

这个错误通常是因为你通过pip安装的pandas/numpy预编译二进制包使用了你的CPU不支持的指令集(比如AVX2、AVX512等),导致执行时触发非法指令错误。以下是具体修复步骤:

方案一:从源码编译安装适配CPU的版本

  1. 彻底卸载现有相关包
    执行命令卸载用户目录下的pandas、numpy和pyarrow:

    pip3 uninstall -y pandas numpy pyarrow
    
  2. 安装编译依赖
    安装编译所需的系统工具和库:

    sudo apt-get install build-essential python3-dev libopenblas-dev liblapack-dev
    
  3. 从源码编译安装
    使用--no-binary参数强制从源码编译安装,这样会自动适配你的CPU指令集:

    pip3 install --no-binary :all: pandas pyarrow
    

    若嫌编译速度慢,可仅针对numpy和pandas禁用预编译包(这两个是核心依赖):

    pip3 install --no-binary numpy,pandas pandas pyarrow
    

方案二:使用系统包管理器安装(更简单)

Lubuntu的系统仓库提供的pandas包是适配系统CPU编译的,直接安装即可:

sudo apt-get install python3-pandas python3-pyarrow

注意:系统包的版本可能比PyPI上的最新版旧,若你需要特定版本,优先选方案一。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.06 21:10:20