ERROR: Could not build wheels for lxml, which is required to install pyproject.toml-based projects

Python安装 lxml时报错如下:

pip install lxml

ERROR: Could not build wheels for lxml, which is required to install pyproject.toml-based projects_第1张图片

我的解决办法,执行命令:

python3 -m pip install --upgrade pip setuptools wheel

然后再安装:

pip install lxml

之前安装 xlwings 也报错,现在也成功了

 pip install xlwings

如果不行,按照下面执行:

(1)下python版本对应.whl文件,下载地址:https://pypi.org/

(2)搜索包名(想安装什么模块就搜自己需要的):

ERROR: Could not build wheels for lxml, which is required to install pyproject.toml-based projects_第2张图片

(3)找到对应版本然后点击:

(4) 点击下载:

(5)下载对应whl文件

ERROR: Could not build wheels for lxml, which is required to install pyproject.toml-based projects_第3张图片

(6)找到文件下面的路径,执行安装命令(我的whl文件放在桌面,后面是包所在路径和包名):

pip install /Users/sunshiyu/Desktop/lxml-4.9.3-pp39-pypy39_pp73-macosx_11_0_x86_64.whl

如果还不能解决

可以到这里找找解决办法 installing packages :

参考:

已解决Building wheel for lxml (setup.py) … error

你可能感兴趣的:(Python,lxml)