Zsh: Conda/Pip installs command not found

后端 未结 21 1735
忘掉有多难
忘掉有多难 2020-12-02 05:27

So I installed Anaconda and everything is working. After I installed it I decided to switch to oh-my-zsh. I am now getting:

zsh         


        
相关标签:
21条回答
  • 2020-12-02 05:56

    Simply copy your Anaconda bin directory and paste it at the bottom of ~/.zshrc.

    For me the path is /home/theorangeguy/miniconda3/bin, so I ran:

    echo ". /home/theorangeguy/miniconda3/bin" >> ~/.zshrc
    

    This edited the ~/.zshrc. Now do:

    source ~/.zshrc
    

    It worked like a charm.

    0 讨论(0)
  • 2020-12-02 05:59

    I just ran into the same problem. As implicitly stated inside the .zshrc-file (in your user-root-folder), you need to migrate the pathes you've already inserted in your .bash_profile, bashrc or so to resolve this.

    Copying all additional pathes from .bash_profile to .zshrc fixed it for me, cause zsh now knows where to look.

    #add path to Anaconda-bin
    export PATH="/Users/YOURUSERNAME!!/anaconda3/bin:$PATH"
    
     #N.B. for miniconda use
    export PATH="/Users/YOURUSERNAME!!!/miniconda3/bin:$PATH"
    

    Depending on where you installed anaconda this path might be different.

    0 讨论(0)
  • 2020-12-02 05:59

    this solved it for me, and is sure to work add this to ~/.zshrc

    export PATH=path_to_anaconda_bin:$PATH
    

    the answer

    0 讨论(0)
  • 2020-12-02 06:00

    It appears that my PATH is broken in my .zshrc file.

    Open it and add :

    export PATH="$PATH;/Users/Dz/anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/Dz/.rvm/bin"
    

    Doh! Well that would explain everything. How did I miss that little semicolon? Changed:

    export PATH="$PATH:/Users/Dz/anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/Dz/.rvm/bin"
    
    source ~/.zshrc
    echo $HOME
    echo $PATH
    

    We're good now.

    0 讨论(0)
  • 2020-12-02 06:05

    You should do the following:
    1. /home/$USER/anaconda/bin/conda init zsh (or /home/$USER/miniconda3/bin/conda init zsh if you use miniconda)
    2. source ~/.zshrc (or just reopen terminal)

    Why this answer is better than others?

    • You shouldn't reinvent the wheel: there is already command in conda to activate, all you need to do is to call conda with full path
    • Maybe ~/.bash_profile doesn't exist (my case, only ~/.bashrc)
    • You can have bash-specific config inside ~/.bash_profile
    • You don't need manually paste and export any pathes
    0 讨论(0)
  • 2020-12-02 06:05
    1. Open your ~./bashrc
    2. Find the following code (maybe something similar) that launches your conda:
    
        # >>> conda init >>>
        # !! Contents within this block are managed by 'conda init' !!
        __conda_setup="$(CONDA_REPORT_ERRORS=false '/anaconda3/bin/conda' shell.bash hook 2> /dev/null)" if [ $? -eq 0 ]; then
            \eval "$__conda_setup" else
            if [ -f "/anaconda3/etc/profile.d/conda.sh" ]; then
                . "/anaconda3/etc/profile.d/conda.sh"
                CONDA_CHANGEPS1=false conda activate base
            else
                \export PATH="/anaconda3/bin:$PATH"
            fi fi unset __conda_setup
        # <<< conda init <<<
    
    
    1. source ~/.zshrc
    2. Things should work.
    0 讨论(0)
提交回复
热议问题