Mac无法安装ujson、scrapy、cchardet

最近在装爬虫,发现部分模块总是无法顺利安装,问题是同一个

 /usr/local/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c src/twisted/test/raiser.c -o build/temp.macosx-10.6-intel-3.6/src/twisted/test/raiser.o
    /usr/local/bin/clang -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-3.6/src/twisted/test/raiser.o -o build/lib.macosx-10.6-intel-3.6/twisted/test/raiser.cpython-36m-darwin.so
    ld: in '/usr/local/lib/libunwind.dylib', file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libunwind.dylib for architecture i386
    clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
    error: command '/usr/local/bin/clang' failed with exit status 1
这里是关键。
'/usr/local/lib/libunwind.dylib', file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libunwind.dylib for architecture i386

原因是,libunwind.dylib是64位的,而其他需要链接的模块是32位的。

为啥会出现这种情况呢?

ls -l /usr/local/lib/libunwind.dylib 
lrwxr-xr-x  1 caishichao  admin  42  5  3 16:20 /usr/local/lib/libunwind.dylib -> ../Cellar/llvm@4/4.0.1/lib/libunwind.dylib
可以看到,这个文件把link到了llvm上,我可能不知道是装什么东西的装了这个llvm。通过brew uninstall卸载llvm。问题解决!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值