解決fatal error: 'sasl.h' file not found

mac 上安裝python-ldap 的時候報錯如下:

 Modules/LDAPObject.c:18:10: fatal error: 'sasl.h' file not found
    #include <sasl.h>
             ^~~~~~~~
    1 error generated.
    error: command 'cc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1:

解決:

pip install python-ldap==2.4.20 --global-option=build_ext --global-option="-I$(xcrun --show-sdk-path)/usr/include/sasl"
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章