Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 2.7 Python sklearn安装_Python 2.7_Scikit Learn - Fatal编程技术网

Python 2.7 Python sklearn安装

Python 2.7 Python sklearn安装,python-2.7,scikit-learn,Python 2.7,Scikit Learn,我是Python新手,正在尝试安装Python的库scikit learn,但出现以下错误: building data_files sources build_src: building npy-pkg config files running build_py running build_clib No module named msvccompiler in numpy.distutils; trying from distutils customize MSVCCompiler Miss

我是Python新手,正在尝试安装Python的库scikit learn,但出现以下错误:

building data_files sources
build_src: building npy-pkg config files
running build_py
running build_clib
No module named msvccompiler in numpy.distutils; trying from distutils
customize MSVCCompiler
Missing compiler_cxx fix for MSVCCompiler
customize MSVCCompiler using build_clib
building 'libsvm-skl' library
compiling C sources
error: Unable to find vcvarsall.bat

我使用Python2.7,并下载了scikit learn from(从中学习)

发生此错误的原因是安装程序试图编译一些C/C++源代码,但在路径中找不到编译器

在Windows上,我通常发现安装各种Python软件包的已编译二进制版本要容易得多。您可以在此处找到此类预编译包:

scikit学习包位于以下位置:


下载后,只需在文件上调用pip。如果您还没有安装numpy和scipy,请确保从那里安装它们。

您可以在ubuntu上安装sklearn和其他基本库,numpy和scipy,如下所示:

apt-get update; \
apt-get install -y \
  python python-pip \
  python-numpy \
  python-scipy \
  build-essential \
  python-dev \
  python-setuptools \
  libatlas-dev \
  libatlas3gf-base

update-alternatives --set libblas.so.3 \
  /usr/lib/atlas-base/atlas/libblas.so.3; \
update-alternatives --set liblapack.so.3 \
  /usr/lib/atlas-base/atlas/liblapack.so.3

pip install -U scikit-learn
相反,您也可以使用Docker图像,或者使用


您还可以尝试使用顺序设置环境和跟踪机器学习项目,以便使用datmo CLI工具使其可复制。

您的系统中是否安装了Visual Studio?一些lib,比如Numpy,应该构建来安装sklearn。这个优秀的答案有帮助吗?我还建议您使用anaconda。@AndreasMueller:anaconda会让您为链接到更快的“英特尔MKL线性代数”例程而付费,而如果您自己安装二进制软件包,则可以免费获得这些例程。所以我个人不是一个粉丝。Anaconda是免费的mkl供学术使用。如何作为非学术用户免费获得MKL?@AndreasMueller:包括它。@AndreasMueller:我认为该许可证仅用于与MKL进行实际链接,而不是重新发布最终结果。