【问题标题】:scikit-learn : Installation problemsscikit-learn:安装问题
【发布时间】:2014-12-12 19:53:47
【问题描述】:

我尝试在 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

你能帮帮我吗?欢迎任何帮助。谢谢。

【问题讨论】:

  • 尝试通过自制软件安装 gcc,这对我有用

标签: python macos clang scikit-learn


【解决方案1】:

我发现最简单的方法就是使用 Anaconda,它可以为您提供几乎所有科学 Python 包,并且总体上使包管理更加容易。你可以在这里下载:

https://store.continuum.io/cshop/anaconda/

Anaconda 支持的软件包列表:

http://docs.continuum.io/anaconda/pkg-docs.html

【讨论】:

  • 我对 anaconda 有同样的问题:\
猜你喜欢
  • 2017-08-05
  • 1970-01-01
  • 2019-02-03
  • 2019-02-06
  • 2016-06-10
  • 1970-01-01
  • 2015-01-18
  • 2022-01-17
  • 2014-06-05
相关资源
最近更新 更多