当前位置: 首页 > article >正文

AutoDL 云服务器:普通 用户 miniconda 配置

AutoDL 初始状态下只有root用户,miniconda 安装在root用户目录下

///

增加普通用户

root@autodl-container-1c0641804d-5bb7040c:~/Desktop# apt update

root@autodl-container-1c0641804d-5bb7040c:~/Desktop#  apt install sudo

root@autodl-container-1c0641804d-5bb7040c:~/Desktop# adduser zhenglf

root@autodl-container-1c0641804d-5bb7040c:~/Desktop# usermod -aG sudo zhenglf

root@autodl-container-1c0641804d-5bb7040c:~/Desktop# su zhenglf

普通用户conda配置

zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$ python
bash: python: command not found
zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$
zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$ conda
bash: conda: command not found
zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$
zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$ sudo /root/miniconda3/bin/conda init bash
no change     /root/miniconda3/condabin/conda
no change     /root/miniconda3/bin/conda
no change     /root/miniconda3/bin/conda-env
no change     /root/miniconda3/bin/activate
no change     /root/miniconda3/bin/deactivate
no change     /root/miniconda3/etc/profile.d/conda.sh
no change     /root/miniconda3/etc/fish/conf.d/conda.fish
no change     /root/miniconda3/shell/condabin/Conda.psm1
no change     /root/miniconda3/shell/condabin/conda-hook.ps1
no change     /root/miniconda3/lib/python3.8/site-packages/xontrib/conda.xsh
no change     /root/miniconda3/etc/profile.d/conda.csh
no change     /home/zhenglf/.bashrc
No action taken.
zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$
zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$ source  /home/zhenglf/.bashrc
zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$
zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$ cat  /home/zhenglf/.bashrc | grep conda
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/root/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
    eval "$__conda_setup"
    if [ -f "/root/miniconda3/etc/profile.d/conda.sh" ]; then
        . "/root/miniconda3/etc/profile.d/conda.sh"
        export PATH="/root/miniconda3/bin:$PATH"
unset __conda_setup
# <<< conda initialize <<<
zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$
zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$ conda
bash: conda: command not found
zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$
zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$ sudo chmod -R 777 /root
zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$
zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$ conda
usage: conda [-h] [-V] command ...

conda is a tool for managing and deploying applications, environments and packages.

Options:

positional arguments:
  command
    clean        Remove unused packages and caches.
    compare      Compare packages between conda environments.
    config       Modify configuration values in .condarc. This is modeled after the git config command. Writes to the user .condarc file (/home/zhenglf/.condarc) by default.
    create       Create a new conda environment from a list of specified packages.
    help         Displays a list of available conda commands and their help strings.
    info         Display information about current conda install.
    init         Initialize conda for shell interaction. [Experimental]
    install      Installs a list of packages into a specified conda environment.
    list         List linked packages in a conda environment.
    package      Low-level conda package utility. (EXPERIMENTAL)
    remove       Remove a list of packages from a specified conda environment.
    uninstall    Alias for conda remove.
    run          Run an executable in a conda environment. [Experimental]
    search       Search for packages and display associated information. The input is a MatchSpec, a query language for conda packages. See examples below.
    update       Updates conda packages to the latest compatible version.
    upgrade      Alias for conda update.

optional arguments:
  -h, --help     Show this help message and exit.
  -V, --version  Show the conda version number and exit.

conda commands available from other packages:
  env
zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$ conda env list
# conda environments:
#
base                  *  /root/miniconda3

zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$
zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$ conda activate base

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run

    $ conda init <SHELL_NAME>

Currently supported shells are:
  - bash
  - fish
  - tcsh
  - xonsh
  - zsh
  - powershell

See 'conda init --help' for more information and options.

IMPORTANT: You may need to close and restart your shell after running 'conda init'.


zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$
zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$ source  /root/miniconda3/bin/activate
(base) zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$
(base) zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$ conda deactivate
zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$
zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$
zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$ conda activate base
(base) zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$
(base) zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$ which python
/root/miniconda3/bin/python
(base) zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$
(base) zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$

(base) zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$ history
    1  sudo /root/miniconda3/bin/conda init bash
    2  cat  /home/zhenglf/.bashrc
    3  python
    4  python3
    5  source  /home/zhenglf/.bashrc
    6  python
    7  reset
    8  python
    9  conda
   10  sudo /root/miniconda3/bin/conda init bash
   11  cat  /home/zhenglf/.bashrc
   12  cat  /home/zhenglf/.bashrc | grep conda
   13  reset
   14  python
   15  conda
   16  sudo /root/miniconda3/bin/conda init bash
   17  source  /home/zhenglf/.bashrc
   18  cat  /home/zhenglf/.bashrc | grep conda
   19  conda
   20  sudo chmod -R 777 /root
   21  conda
   22  conda env list
   23  conda activate base
   24  source  /root/miniconda3/bin/activate
   25  conda deactivate
   26  conda activate base
   27  which python
   28  history
(base) zhenglf@autodl-container-b8974ea189-5aa9b74e:/root$

///


http://www.kler.cn/a/524348.html

相关文章:

  • 《使用通道 Transformer 进行多尺度特征融合,引导热图像超分辨率》学习笔记
  • CTFSHOW-WEB入门-命令执行29-32
  • 【Git】使用笔记总结
  • 【数据结构】空间复杂度
  • 【数据结构】 并查集 + 路径压缩与按秩合并 python
  • 阿里巴巴开发规范手册MySQL工程结构
  • 二叉树介绍
  • Java多线程与高并发专题——JMM
  • 实验作业管理系统的设计与实现
  • Leetcode刷题-不定长滑动窗口
  • Vue 组件开发:构建高效可复用的前端界面要素
  • Spark Streaming的背压机制的原理与实现代码及分析
  • 力扣面试150 快乐数 循环链表找环 链表抽象 哈希
  • Java中实现ECDSA算法介绍、应用场景和示例代码
  • 机器人介绍
  • 《HelloGitHub》第 106 期
  • 扣子平台音频功能:让声音也能“智能”起来。扣子免费系列教程(14)
  • 【Linux权限】—— 于虚拟殿堂,轻拨密钥启华章
  • YOLOv11-ultralytics-8.3.67部分代码阅读笔记-head.py
  • 基于SpringBoot的假期周边游平台的设计与实现(源码+SQL脚本+LW+部署讲解等)
  • JAVA实战开源项目:企业客户管理系统(Vue+SpringBoot) 附源码
  • C++并发编程指南04
  • 传统机器学习和深度学习
  • 29. C语言 可变参数详解
  • 谷堆论证引发的商业思考
  • 虚幻基础11:坐标计算旋转计算