Python的库sklearn安装 bazel安装 cmake

news/2024/7/9 8:42:23 标签: sklearn, bazel, cmake

Python的库sklearn安装

也可以用pip安装(如:pip installscikit-learn),但安装的位置不同,安装是包名不同(apt-get安装的python包一般前缀是python),python用的时候优先选择apt-get安装的包。如果用pip freeze 安装的包的版本和在python环境(进入python导包,查看版本)看到的版本不同,可能就是用apt-getpip都安装了,然后选择性的保留就行了(建议保留pip的)

 

安装scipy 0.16.1

1scipy需要依赖numpy包,先安装numpy

2、用pip install scipy==0.16.1安装scipy,安装时报错:building 'dfftpack' library error:library dfftpacy hasFortran sources but no Fortran compiler found。这是没有安装gfortran编译器(没有gfortran编译器),安装gfortran命令如下:sudo apt-getinstall gfortran

3、重新安装scipy,安装时又报了 numpy.distutils.system_info.NotFoundError:no lapack/blas resources found 

4、用ls

 /usr/lib | grep blas查看,缺少了一些libopenblas系统库(缺少libopenblas),用sudo

 apt-get install libopenblas-dev安装该库,安装后查看如下:


5、重新用用pip install scipy==0.16.1安装scipy,结果依然报同一个错误,网上查结果缺少 lapack 

库(缺少lapack),安装 lapack 包:$

 sudo apt-get install liblapack-dev,如果还是不行则是缺少

atlas 再安装 atlas包:sudo

 apt-get install libatlas-dev

6、安装成功后重新安装

 scipy pip install scipy==0.16.1成功完成安装。

网上查询后的总结:安装numpy后安装scipy失败(报错:numpy.distutils.system_info.NotFoundError)一般是缺少一些系统库,需要安装:libopenblas-devliblapack-devlibatlas-devlibblas-dev

 

Python Installation Instructions

Precompiledpackages are available for linux x86_64 platform and python 2.

  • Install stable version: pip install gbdt
  • Install latest development version: pip install git+https://github.com/yarny/gbdt.git

gbdt安装python版本------

**pip源码安装;***yum installpython-devel.x86_64  yum installpython27-python-devel.x86_64  ---> pipinstall numpy >= 0.6 && pip install SciPy >= 0.9 ;(numpy.distutils.system_info.NotFoundError: no lapack/blas resources found)--->  yum install blas* && yuminstall lapack* --->  pip installSciPy ( python -c "import scipy; print scipy.__version__") & pipinstall sklearn

 

C++ Binary Compilation Instructions

Thepackage can be compiled in both Linux and OSX platforms. It depends on bazel, gflags,glogs, gperf, protobuf3. Per limitation of bazel, for linux, please use ubuntu 14 andabove to build. The built binary can be used in lower version linux machine. Weinclude a convenient script to set up the dependencies.

  1. Install bazel
  2. Run setup_dependencies/setup.sh.   ---》 需要cmake命令
  3. Run bazel build -c opt src:gbdt to build the binary.
  4. Find your binary at bazel-bin/src/gbdt.

5.       安装c 版本,但是需要bazel支持,bazel又需要依赖JDK1.8

6.       /usr/local/bazel

7.        

8.      ####安装JDK略过

9.      ### 安装bazel

10.  https://github.com/bazelbuild/bazel/releases下载源码。。。

11.   

12.  

13.    ####[@10.134.105.160 GBDT]#./bazel-0.4.4-installer-darwin-x86_64.sh --user

14.      raw set itself is deprecated.

15.    - Remove support for --javawarn; use e.g.--javacopt=-Xlint:all

16.      instead

17.   

18.  ## Build informations

19.     - [Build log](http://ci.bazel.io/job/Bazel/JAVA_VERSION=1.8,PLATFORM_NAME=darwin-x86_64/1246/)

20.     -[Commit](https://github.com/bazelbuild/bazel/commit/80a07b5)

21.  Uncompressing.......

22.   

23.  Bazel is now installed!

24.   

25.  Make sure you have"/root/bin" in your path. You can also activate bash

26.  completion by adding thefollowing line to your ~/.bashrc:

27.    source /root/.bazel/bin/bazel-complete.bash

28.   

29.  Seehttp://bazel.build/docs/getting-started.html to start a new project!

30.  [@10.134.105.160 GBDT]#

Linux(centos7)源码安装cmake

1. 下载cmake源码

[html] view plain copy

1. wget https://cmake.org/files/v3.3/cmake-3.3.2.tar.gz  

2.解压缩

[html] view plain copy

1. tar xzvf cmake-3.3.2.tar.gz  

3.进入到cmake文件夹中执行引导命令

注:此时会检查gcc,gcc-c++,是否安装和版本,如果没有请先安装

yum install gcc

yum install gcc-c++

[html] view plain copy

1. cd cmake-3.3.2  

2.   

3. ./bootstrap  

4.执行make

[html] view plain copy

1. gmake  

5.执行安装(root权限)

[html] view plain copy

1. make install  

命令行下查看python和numpy的版本和安装位置

1、查看python版本
方法一:
  python -V
  注意:‘-V‘中‘V’为大写字母,只有一个‘-’
方法二:
  python --version  
  注意:‘--version'中有两个‘-’

2、查看python安装位置
方法一: 
  python -c "import sys; print sys.executable"
方法二:
  python -c "import os; print os.sys.executable"
  python -c "import os; path = os.sys.executable;folder=path[0 : path.rfind(os.sep)]; print folder"

3、查看Numpy版本
python -c "import numpy; print numpy.version.version"
或
python -c "import numpy; print numpy.__version__"
4、查看Numpy安装路径
python -c "import numpy; print numpy.__file__"

http://www.niftyadmin.cn/n/865381.html

相关文章

linux export 环境变量设置

在Linux里设置环境变量的方法(export PATH) 在Linux里设置环境变量的方法(export PATH)一般来说,配置交叉编译工具链的时候需要指定编译工具的路径,此时就需要设置环境变量。例如我的mips-linux-gcc编译器在…

hadoop streaming python 处理 lzo 文件遇到的问题

1, 代码中需要注意的有: [python] view plaincopy print?#!/usr/bin/env python #coding:utf8 line line.decode("utf8") try: except Exception,ex: pass 这些点都需要注意,否则,一个小问题就会导致任务失败 其…

redis 值 hiredis (c/c++)

0 前言: python 版的redis 直接pyredis接口(pip install 即可);redis server的安装(参照http://www.cnblogs.com/lpshou/p/3167396.html 不错的); 本次是c 引入hiredis第三方模块 ~ GitHub最新的…

Tersorflow深度学习入门—— CIFAR-10 训练示例报错及解决方案

前言:相关环境搭建 TF(tensorflow)安装之python tensorflow 之 bazel安装 & 使用 Python的库sklearn安装 & bazel安装 & cmake GBDT安装(xgboost LightGBM) GBDT 之 Boosting方法 linux export 环境…

linux crontab -e报错 || 不执行 || expected unqualified-id before

0, 前言: 1,linux 新安装的centOS 或小红包系统,第一次执行crontab -e命令报错 Error detected while processing /root/.vim/bundles.vim: 2,Linux下定时任务(秒级别)的实现 --- crontab仅仅可以分钟级别…

urlencode quote unquote (url 中带中文参数)

目录: urlencode & quote & unquote (url 中带中文参数) python httplib urllib urllib2区别(一撇) 当url地址含有中文或者“/”的时候,这是就需要用做urlencode一下编码转换。 1)其中python2.x需要urllib.u…

LibLinear使用总结(L1,L2正则)

liblinear实践初步 在相关推荐项目的改版中,对liblinear/fm/xgboost等主流成熟算法模型的训练效果进行了尝试和对比,并在一期改造中选择了liblinear实际上线使用。本文主要从工程应用的角度对liblinear涉及的各模式进行初步介绍,并给出libli…

hadoop streaming (shell执行 combiner 数据分割)

1,前言 --- 先上干货:hadoop.streaming 的一个完整的shell脚本;hadoop streaming (shell执行脚本实例 & combiner初探 & 数据分割) ### 2--- tasks 22 HADOOP/usr/bin/hadoop 23 24 local_file"./wc.data&qu…