pip 安装lxml编译失败处理

安装环境

Ubuntu 20.04

错误信息

note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for lxml
  Running setup.py clean for lxml
Failed to build lxml
ERROR: Could not build wheels for lxml, which is required to install pyproject.toml-based projects

处理方案

  1. 先安装依赖包

    sudo apt-get install libxml2 libxslt-dev
    
  2. 重新安装lxml

    pip install lxml==4.2.5
    

你可能感兴趣的:(环境处理,pip,python)