Conda activate not working?

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

    Have you tried with Anaconda command prompt or, cmd it works for me. Giving no error and activation is not working in PowerShell may be some path issue.

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

    Here's what worked for me using the Git Bash terminal in VS Code on windows in succinct steps:

    1. source activate env-name - You should see your line appended by the (base) tag now.

    2. After calling on source activate, I've found following conda activate commands to work: i.e. conda activate env2-name

    What didn't work for Git Bash (as a VS Code terminal) for me: activate env-name and conda activate env-name.

    Not exactly sure why this specific behaviour occurs on the Git Bash terminal on VS Code, but the accepted answer + this stackoverflow question I've found might provide clues.

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

    Just use this command in your cmd:

    activate <envname>

    Works like charm! (worked for windows, don't know about mac)

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

    To use "conda activate" via Windows CMD, not the Anaconda Prompt:
    (in response to okorng's question, although using the Anaconda Prompt is the preferred option)

    First, we need to add the activate.bat script to your path:
    Via CMD:

    set PATH=%PATH%;<your_path_to_anaconda_installation>\Scripts
    

    Or via Control Panel, open "User Accounts" and choose "Change my environment variables".

    Then calling directly from Windows CMD:

    activate <environment_name>
    

    without using the prefix "conda".

    (Tested on Windows 7 Enterprise with Anaconda3-5.2.0)

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