How to install Anaconda python for all users?

前端 未结 4 1804
心在旅途
心在旅途 2021-01-30 12:38

Anaconda python distribution is very convenient to deploy scientific computing env (SCE) and switch python versions as you want. By default, the installation will locate python

4条回答
  •  攒了一身酷
    2021-01-30 13:37

    You definitely need to install to a path which is accessible from all users. /opt/YOUR_CONDA_DISTRIB_NAME is a good candidate.

    However you also have to add conda path which automatically happens when you add the following shell script to other users' .bashrc files. You can find the shell script in the root user's .bashrc file. For the record, I bring it here:

    
    # >>> conda initialize >>>
    # !! Contents within this block are managed by 'conda init' !!
    __conda_setup="$('/opt/YOUR_CONDA_DISTRIB_NAME/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
    if [ $? -eq 0 ]; then
        eval "$__conda_setup"
    else
        if [ -f "/opt/YOUR_CONDA_DISTRIB_NAME/etc/profile.d/conda.sh" ]; then
            . "/opt/YOUR_CONDA_DISTRIB_NAME/etc/profile.d/conda.sh"
        else
            export PATH="/opt/YOUR_CONDA_DISTRIB_NAME/bin:$PATH"
        fi
    fi
    unset __conda_setup
    # <<< conda initialize <<<
    
    
    

    P.S. a few common names which Anaconda commonly uses for YOUR_CONDA_DISTRIB_NAME:

    • anaconda
    • anaconda3
    • miniconda
    • miniconda3

提交回复
热议问题