【Linux】CentOS搭建Tensorflow环境

本文详细介绍了如何在CentOS系统上通过Anaconda3安装并创建虚拟环境,以及如何在环境中安装Tensorflow。首先,通过yum安装wget,然后下载并安装Anaconda3,同意许可协议并选择安装路径。接着,配置环境变量,创建支持Tensorflow的Python 3.5环境。在conda环境中安装Tensorflow时可能会遇到问题,文章提供了参考资料以解决安装过程中遇到的错误。
摘要由CSDN通过智能技术生成

步骤

安装Anaconda3

wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2020.02-Linux-x86_64.sh

如果提示没有wget,使用yum安装:

yum -y install wget

在下载目录中执行该文件,根据下载的版本不同,名称会有不同:

bash Anaconda3-2020.02-Linux-x86_64.sh

接下来会出现一堆的License许可声明,一路回车向下,出现如下文字,输入yes:

Do you accept the license terms? [yes|no]
[no] >>> 
Please answer 'yes' or 'no':
>>> yes

之后要选择安装目录,如果无需更改直接回车Enter,如需更改要输入绝对路径:
(可以先查看下硬盘的挂载情况再自行选择安装目录,查看挂载情况的语句是df -h)

Anaconda3 will now be installed into this location:
/root/anaconda3

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

[/root/anaconda3] >>> 

出现如下信息:

ERROR: File or directory already exists: '/root/anaconda3'
If you want to update an existing installation, use the -u option.

安装到一个新的路径,比如/root/caozx/22-anaconda3(22-anaconda3还未创建)

[/root/anaconda3] >>>  /root/caozx/22-anaconda3

询问是否初始化,若选择yes,是在/root/.bashrc目录中自动添加环境变量,会使得开机自动启动base环境。(这里应该是新版安装包的改动之处,老版本的安装包都是问是否需要添加conda至环境变量,且默认直接回车Enter是不添加,若未添加后续需要手动添加。)

Do you wish the installer to initialize Anaconda3
by running conda init? [yes|no]
[no] >>> no

看到如下提示则安装成功:

Thank you for installing Anaconda3!

===========================================================================

Anaconda and JetBrains are working together to bring you Anaconda-powered
environments tightly integrated 
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值