zoukankan      html  css  js  c++  java
  • anaconda安装 与 共享虚拟环境 2020

    1、官网下载:

    下载到当前目录
    wget https://repo.anaconda.com/archive/Anaconda3-2020.07-Linux-x86_64.sh

    2、安装
    bash Anaconda3-2020.07-Linux-x86_64.sh

    2.1 在安装过程中,需要你允许使用协议,输入yes即可:
    Do you accept the license terms? [yes|no]
    [no] >>>
    Please answer 'yes' or 'no':'
    >>> yes

    2.2 指定安装目录

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

    modified /root/.bashrc
    -- 新增内容如下:
    (
    # >>> conda initialize >>>
    # !! Contents within this block are managed by 'conda init' !!
    __conda_setup="$('/mnt/Anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
    if [ $? -eq 0 ]; then
    eval "$__conda_setup"
    else
    if [ -f "/mnt/Anaconda3/etc/profile.d/conda.sh" ]; then
    . "/mnt/Anaconda3/etc/profile.d/conda.sh"
    else
    export PATH="/mnt/Anaconda3/bin:$PATH"
    fi
    fi
    unset __conda_setup
    # <<< conda initialize <<<
    )

    ==> For changes to take effect, close and re-open your current shell. <==

    2.4 If you'd prefer that conda's base environment not be activated on startup,
    set the auto_activate_base parameter to false


    Thank you for installing Anaconda3!


    3、共享虚拟环境
    3.1 在服务器A, 创建虚拟环境
    conda create -n env_name python=version
    (如:conda create -n simhash python=3.7)

    3.1、 在服务器A, 激活虚拟环境,导出配置文件
    conda activate env_name
    conda env export --file env_name.yml

    (注意:
    如果是windows平台的*.yml 运行到linux平台上,可能会出现 找不到包 报错,
    解决方法:在*.yml文件中,将找不到的包从dependencies段落 移动到pip段落)

    3.2 在服务器B,根据配置文件创建虚拟环境
    conda env create -f /xx/xx/env_name.yml


    4、其他常用命令
    查看虚拟环境 conda env list
    激活虚拟环境 conda activate env_name
    退出虚拟环境 conda deactivate
    删除虚拟环境 conda remove -n env_name --all
    安装包 conda install package_name pip install package_name
    列出所有包 conda list
    更新包 conda update package_name
    一次性更新所有包 conda update --all
    查找包 conda search
    删除包 codna remove package_name

  • 相关阅读:
    78. Subsets
    93. Restore IP Addresses
    71. Simplify Path
    82. Remove Duplicates from Sorted List II
    95. Unique Binary Search Trees II
    96. Unique Binary Search Trees
    312. Burst Balloons
    程序员社交平台
    APP Store开发指南
    iOS框架搭建(MVC,自定义TabBar)--微博搭建为例
  • 原文地址:https://www.cnblogs.com/lyy-totoro/p/13802648.html
Copyright © 2011-2022 走看看