• 远程登陆Ubuntu服务器anaconda的使用问题(多用户)


    远程登录Ubuntu的新用户在使用 conda 命令时,可能会遇到找不到 conda 命令的情况,因此在多用户使用 anaconda 的情况下,需要提前在 Ubuntu 服务器上做一下 anaconda 的配置。

    anaconda 的安装过程省略。

    1、添加环境变量

    首先需要编辑 /etc/profile 文件

    sudo vim  /etc/profile

    按 i 键编辑,在文件最后添加以下语句

    export PATH=/home/[安装anaconda的用户名]/anaconda3/bin:$PATH

    按 ESC 键退出编辑,然后依次输入 :wq 保存退出,然后 source 一下这个文件夹,这样就将anaconda 添加到全局的环境变量中了。

    source /etc/profile

    可以使用以下命令查看当前的环境变量

    echo $PATH

    2、用户首次远程连接时需要初始化 conda 的 shell 环境

    用户初次远程连接服务器使用 conda 命令时会出现以下提示:

    CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.

    完整的提示如下:

    1. CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
    2. To initialize your shell, run
    3. $ conda init
    4. Currently supported shells are:
    5. - bash
    6. - fish
    7. - tcsh
    8. - xonsh
    9. - zsh
    10. - powershell
    11. See 'conda init --help' for more information and options.
    12. IMPORTANT: You may need to close and restart your shell after running 'conda init'.

    此时按照提示运行一下下面的指令执行 shell 初始化即可

    conda init bash

    然后还需要 source 一下当前用户的 .bashrc 文件

    source .bashrc

    如果不知道当前用户使用的什么类型的 shell 的话,可以使用以下指令查看用户信息:

    cat /etc/passwd

    每条信息最后一个冒号后面的就是当前用户的 shell 类型,一般默认都是 bash。

  • 相关阅读:
    ONLYOFFICE8.1版本桌面编辑器测评
    解析几何:计算两条线段的交点
    支付媒介的演变与创新
    拒绝蛮力,高效查看Linux日志文件!
    Golang字符串基本处理方法
    【Vue实战】基于Vue的九宫格在线抽奖附源代码
    54. 螺旋矩阵 & 59. 螺旋矩阵 II ●●
    easyswoole学习记录
    上海亚商投顾:沪指冲高回落 纺织服装股午后集体走强
    隧道代理-
  • 原文地址:https://blog.csdn.net/Flag_ing/article/details/127779795