mac osx 10.10 pip 安装问题
在mac osx 升級(jí)到 10.10(Yosemite)以后,用pip以及easy_install 安裝python包的時(shí)候,如果包需要編譯,就會(huì)編譯失敗,錯(cuò)誤如下:
build/temp.macosx-10.10-x86_64-2.7/greenlet.o -o build/lib.macosx-10.10-x86_64-2.7/greenlet.so
ld: file not found: python.exe
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1
xcode升級(jí)到6.1以后python安裝編譯默認(rèn)clang
當(dāng)時(shí)很困惑為什么在osx中出現(xiàn)python.exe, stackoverflow 上說這只是osx中默認(rèn)的名稱,沒有實(shí)際意義,可忽略
在stackoverflow中給的答案:
可以在 pip install 之前加上 ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future 忽略這個(gè)報(bào)錯(cuò),但是這并沒有解決問題
真正的問題在于python本身的問題,造成不能正常安裝
問題在于:在 Python 的源碼里configure.ac :
????????case $ac_sys_system/$ac_sys_release in
????????...
????????Darwin/*)
????????????????# Use -undefined dynamic_lookup whenever possible (10.3 and later).
????????????????# This allows an extension to be used in any Python
????????????????if test ${MACOSX_DEPLOYMENT_TARGET} '>' 10.2
????????????????then
????????????????????????if test "${enable_universalsdk}"; then
????????????????????????????????LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
????????????????????????fi
????????????????????????LDSHARED='$(CC) -bundle -undefined dynamic_lookup'
????????????????????????LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup'
????????????????????????BLDSHARED="$LDSHARED"
????????????????else
????????????????????????LDSHARED='$(CC) -bundle'
問題出在?? if test ${MACOSX_DEPLOYMENT_TARGET} '>' 10.2?
版本10.10 < 10.2 真正的問題來了
解決辦法
首先需要安裝Command-Line Tool(如果沒有安裝 執(zhí)行命令xcode-select --install 進(jìn)行安裝)
在python2.7.6以下都有這個(gè)問題,最簡(jiǎn)單的辦法是安裝2.7.8以上
?
轉(zhuǎn)載于:https://www.cnblogs.com/iminic/p/4167670.html
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)總結(jié)
以上是生活随笔為你收集整理的mac osx 10.10 pip 安装问题的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 玛雅海外的团队如何?
- 下一篇: ecshop后台增加模板页的方法