Zsh: Conda/Pip installs command not found

后端 未结 21 1736
忘掉有多难
忘掉有多难 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 06:06

    If you are on macOS Catalina, the new default shell is zsh. You will need to run source /bin/activate followed by conda init zsh. For example: I installed anaconda python 3.7 Version, type echo $USER to find username

    source /Users/my_username/opt/anaconda3/bin/activate
    

    Follow by

    conda init zsh
    

    or (for bash shell)

    conda init
    

    Check working:

    conda list
    

    The error will be fixed.

    0 讨论(0)
  • 2020-12-02 06:06
    1. Find the right version of your anaconda

    2. Put it to ~/.zshrc via command vim ~/.zshrc

      • Anaconda 2 export PATH="/User/<your-username>/anaconda2/bin:$PATH"
      • Anaconda 3 export PATH="/User/<your-username>/anaconda3/bin:$PATH"
      • Or if you install Anaconda in root directory:
      • Anaconda 2 export PATH="/anaconda2/bin:$PATH"
      • Anaconda 3 export PATH="/anaconda3/bin:$PATH"
    3. Restart the zsh source ~/.zshrc

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

    So I discovered that in your ~/.zshrc file, there was a commented line,

    # If you come from bash you might have to change your $PATH # export PATH=$HOME/bin:/usr/local/bin:$PATH

    Just uncomment the export statement and all your previous bash_profile commands will also be there. If that comment does not exist, you can also just add that export statement to .zshrc file.

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

    None of these solutions worked for me. I had to append bash environment to the zsh:

    echo 'source ~/.bash_profile' >> ~/.zshrc
    
    0 讨论(0)
  • 2020-12-02 06:10

    If anaconda is fully updated, a simple "conda init zsh" should work. Navigate into the anaconda3 folder using

    cd /path/to/anaconda3/

    of course replacing "/path/to/anaconda/" with "~/anaconda3" or "/anaconda3" or wherever the "anaconda3" folder is kept.

    To make sure it's updated, run

    ./bin/conda update --prefix . anaconda

    After this, running

    ./bin/conda init zsh

    (or whatever shell you're using) will finish the job cleanly.

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

    MAC OS Users:

    1. brew install anaconda
    2. Add export PATH="/usr/local/anaconda3/bin:$PATH" to top of ~/.zshrc
    3. source ~/.zshrc OR restart terminal

    Test it. Bingo Bango.

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