当前位置:   article > 正文

Linux 安装Anaconda3_anaconda3 linux

anaconda3 linux

1. 下载安装包

anaconda官网下载链接

image-20231008193217717

2. 上传

上传到Linux的任意文件夹就可以

image-20231008193410763

3. 运行安装包

  • 执行下面命令:

注意在安装过程中所有需要输入字符的地方都不支持 删除键(backspace),千万不要打错

如果输入错误就 ctrl + C 再来一遍吧!

[root@glnode01 export]# sh ./Anaconda3-2023.09-0-Linux-x86_64.sh 
  • 1
  • 回车继续

image-20231008193628664

  • 空格翻页

image-20231008193650665

  • 输入yes千万不要打错

image-20231008193725848

  • 输入你要安装的位置

image-20231008193829533

  • 继续yes

image-20231008194200488

完成安装

4. 重启终端

启动一个新的终端会话窗口,看到前面的(base),表示安装成功

image-20231008194359772

5. 配置国内源点

  • 修改党前用户下的 .condarc 文件(一开始不存在,直接创建)
(base) [root@glnode01 ~]# vim ~/.condarc
  • 1
  • 将下面内容直接复制进去
channels:
  - defaults
show_channel_urls: true
default_channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

6. 创建一个 conda 环境

  • 创建一个名为 pyspark 的环境,使用 python 3.8 的环境
(base) [root@glnode01 ~]# conda create -n pyspark python=3.8
  • 1
  • 输入 y 继续

image-20231008201423315

等待一会即可创建完成

  • 使用下面命令激活新创建的环境
(base) [root@glnode01 ~]# conda activate pyspark
  • 1
  • 前面的环境变为了 (pyspark) ,即切换成功
(pyspark) [root@glnode01 ~]# 
  • 1

7. 添加环境变量

  • 修改下面文件
[root@glnode01 profile.d]# vim /etc/profile
  • 1
  • 加入下面环境变量
# pyspark python 
export PYSPARK_PYTHON=/export/servers/Anaconda3/envs/pyspark/bin/python3.8
  • 1
  • 2
  • 加入下面环境变量
# pyspark python 
export PYSPARK_PYTHON=/export/servers/Anaconda3/envs/pyspark/bin/python3.8
  • 1
  • 2
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/265072
推荐阅读
相关标签
  

闽ICP备14008679号