How to install Anaconda python for all users?

前端 未结 4 1791
心在旅途
心在旅途 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:36

    Add the anaconda PATH to /etc/profile:

    for anaconda 2 :

    PATH=$PATH:$HOME/anaconda/bin
    

    for anaconda 3 :

    PATH=$PATH:$HOME/anaconda3/bin
    

    and then :

    source /etc/profile
    
    0 讨论(0)
  • 2021-01-30 13:37

    Anaconda Cluster from Continuum that addresses these issues. Check out https://docs.continuum.io/anaconda-scale/

    0 讨论(0)
  • 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
    0 讨论(0)
  • 2021-01-30 13:39

    The installer lets you install anywhere. You can install it to a global location, like /opt/anaconda.

    0 讨论(0)
提交回复
热议问题