Conda activate not working?

前端 未结 16 1443
失恋的感觉
失恋的感觉 2020-12-02 16:38
 gonzo  ~/a/packages  conda env list
# conda environments:
#
ppo_latest               /nohome/jaan/abhishek/anaconda3/envs/ppo_latest
root                  *  /noh         


        
相关标签:
16条回答
  • 2020-12-02 17:05

    I just ran into a similar issue. Recently started developing on windows, so getting used to the PowerShell. Ironically when trying to use 'conda activate ' in Git-bash i got the error

    $ conda activate obf
    
    CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
    If using 'conda activate' from a batch script, change your
    invocation to 'CALL conda.bat activate'.
    
    To initialize your shell, run
    
        $ conda init <SHELL_NAME>
    
    Currently supported shells are:
      - bash
      - cmd.exe
      - fish
      - tcsh
      - xonsh
      - zsh
      - powershell
    
    See 'conda init --help' for more information and options.
    
    IMPORTANT: You may need to close and restart your shell after running 'conda init'. 
    

    Running the command in my PowerShell (elevated) as instructed did the trick for me.

    conda init powershell 
    

    This should be true across all terminal environments, just strange PowerShell didn't return this error itself.

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

    As of conda 4.4, the command

    conda activate <envname>
    

    is the same on all platforms. The procedure to add conda to the PATH environment variable for non-Windows platforms (on Windows you should use the Anaconda Prompt), as well as the change in environment activation procedure, is detailed in the release notes for conda 4.4.0.


    For conda versions older than 4.4, command is either

    source activate <envname>
    

    on Linux and macOS or

    activate <envname>
    

    on Windows. You need to remove the conda.

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

    After installing conda in Linux if you are trying to create env just type bash and hit Enter later you can create env

    0 讨论(0)
  • 2020-12-02 17:08

    Functions are not exported by default to be made available in subshells. I'd recommend you do:

    source ~/anaconda3/etc/profile.d/conda.sh
    conda activate my_env
    

    In the commands above, replace ~/anaconda3/ with the path to your miniconda / anaconda installation.

    0 讨论(0)
  • 2020-12-02 17:08

    The anaconda functions are not exported by default, it can be done by using the following command:

    $ source ~/anaconda3/etc/profile.d/conda.sh $ conda activate my_env

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

    If your console does not show (base) after running conda activate base, then try running:

    conda init

    Then running conda activate <your_env> should show the name of (<your_env>) at the beginning of the shell prompt.

    This worked for me on Windows. My PATH environment variable was set properly so conda activate base did not raise any error but quietly failed.

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