Mac 下安装 uWSGI 失败 / 找不到 libxml/parser.h

pip install uWSGI

报错:

core/xmlconf.c:9:10: fatal error: 'libxml/parser.h' file not found
    #include <libxml/parser.h>
             ^~~~~~~~~~~~~~~~~
    1 error generated.

尝试了网上的各种办法,都不行,比如

brew uninstall libxml2
brew install --with-python libxml2

最终解决方案:

# 创建软链接
ln -s /usr/include/libxml2/libxml /usr/include/libxml
# 然后再次安装
pip install uWSGI