我正在尝试在OSX中安装机器学习包 scikit-learn 失败。
当我编写命令“python setup.py install”来检查我的安装是否正常时,我得到了
build_src: building npy-pkg config files
running build_py
running build_clib
customize UnixCCompiler
#### ['clang', '-fno-strict-aliasing', '-fno-common', '-dynamic', '-g', '-Os', '-pipe', '-fno- common', '-fno-strict-aliasing', '-fwrapv', '-mno-fused-madd', '-DENABLE_DTRACE', '-DMACOSX', '-DNDEBUG', '-Wall', '-Wstrict-prototypes', '-Wshorten-64-to-32', '-DNDEBUG', '-g', '-Os', '-Wall', '-Wstrict-prototypes', '-DENABLE_DTRACE', '-arch', 'i386', '-arch', 'x86_64'] #######
**Missing compiler_cxx fix for UnixCCompiler**
customize UnixCCompiler using build_clib
building 'libsvm-skl' library
compiling C++ sources
C compiler: clang++ -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict- aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe
compile options: '-I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -c'
clang++: src/libsvm/libsvm_template.cpp
clang: error: no such file or directory: 'src/libsvm/libsvm_template.cpp'
clang: error: no input files
clang: error: no such file or directory: 'src/libsvm/libsvm_template.cpp'
clang: error: no input files
error: Command "clang++ -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -c src/libsvm/libsvm_template.cpp -o build/temp.macosx-10.8-intel-2.7/src/libsvm/libsvm_template.o" failed with exit status 1
我已经安装了clang版本:
Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
你能帮帮我吗?欢迎任何帮助。感谢。
答案 0 :(得分:0)
我发现最简单的方法就是使用Anaconda,它将为您提供阳光下的每个科学Python软件包,并使包管理更容易。你可以在这里下载:
https://store.continuum.io/cshop/anaconda/
Anaconda支持的软件包列表: