Conda activate not working?

前端 未结 16 1618
失恋的感觉
失恋的感觉 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:01

    I just created a new environment with conda and things are different. My sys.path was not correct for a bit until I figured out way.

    As a result, I want to point out for anyone else confused by a change in conda, that if you have upgraded conda and created an environment, it will now tell you (as opposed to previous behavior):

    # To activate this environment, use
    #
    #     $ conda activate test
    #
    # To deactivate an active environment, use
    #
    #     $ conda deactivate
    

    Thus, the new way to activate/deactivate environments is to do it like the above.

    Indeed, if you upgrade from an older version of conda and you try the above, you may see the following helpful message (which I did):

    CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
    If your shell is Bash or a Bourne variant, enable conda for the current user with
    
        $ echo ". ~/anaconda/etc/profile.d/conda.sh" >> ~/.bash_profile
    
    or, for all users, enable conda with
    
        $ sudo ln -s ~/anaconda/etc/profile.d/conda.sh /etc/profile.d/conda.sh
    
    The options above will permanently enable the 'conda' command, but they do NOT
    put conda's base (root) environment on PATH.  To do so, run
    
        $ conda activate
    
    in your terminal, or to put the base environment on PATH permanently, run
    
        $ echo "conda activate" >> ~/.bash_profile
    
    Previous to conda 4.4, the recommended way to activate conda was to modify PATH in
    your ~/.bash_profile file.  You should manually remove the line that looks like
    
        export PATH="~/anaconda/bin:$PATH"
    
    ^^^ The above line should NO LONGER be in your ~/.bash_profile file! ^^^
    

    Changing the above fixed my issues with sys.path in activated conda environments.

提交回复
热议问题