CentOS7人工智能工程师-环境配置-安装Python3.6+anaconda+pip+xgboost+Tensorflow

1.指定yum源并更新最新软件包

yum install -y https://centos7.iuscommunity.org/ius-release.rpm && yum update

2.安装python3.6

yum install -y python36u python36u-libs python36u-devel python36u-pip

或者

yum install -y python36u*

3.安装 anaconda

/*yum install -y  anaconda*/

(1).点击从官网下载 (anaconda

  用命令下载:curl https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh >> Anaconda3-5.2.0-Linux-x86_64.sh

(2).安装 bash Anaconda3-5.0.1-Linux-x86_64.sh

(2).将路径添加到PATH中:export PATH=/root/anaconda3/bin:$PATH

(4).测试:conda --versio

如需调出图形界面,请执行:

 source ~/anaconda3/bin/activate
 anaconda-navigator

4.安装tensorflow

(1).创建tensorflow运行环境:conda create -n tensorflow

(2).启动tensorflow运行环境:

source activate tensorflow

/*关闭运行环境:source deactivate tensorflow*/

(3).安装cpu版tensorflow

pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.3.0-cp36-cp36m-linux_x86_64.whl

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
conda install numpy
anaconda search -t conda tensorflow
anaconda show jjh_cio_testing/tensorflow
conda install --channel https://conda.anaconda.org/jjh_cio_testing tensorflow

5.安装pip

yum -y install python-pip

升级pip到最新版本

pip install --upgrade pip

 

6.通过pip安装xgboost

pip install xgboost

如果报安装超时错误则指定超时时间安装即可:

pip --default-timeout=100 install -U xgboost

7.测试tensorflow是否可用

#python

import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()

print(sess.run(hello))

如果输出 hello 则安装成功!

8.注意,下次使用时先启动环境再进python

#source activate tensorflow

#python

 

值得参考的文章:https : // blog.csdn . net /qq_32435729/article/details/78622654

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

one312

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值