How to run Conda?

后端 未结 30 1916
予麋鹿
予麋鹿 2020-11-22 08:56

I installed Anaconda and can run Python, so I assume that I installed it correctly. Following this introductory documentation, I am trying to install Python v3.3, so I am co

30条回答
  •  耶瑟儿~
    2020-11-22 09:45

    Use conda init

    As pointed out in a different answer, manually adding Conda on $PATH is no longer recommended as of v4.4.0 (see Release Notes). Furthermore, since Conda v4.6 new functionality to manage shell initialization via the conda init command was introduced. Hence, the updated recommendation is to run

    Unix/Linux

    ./anaconda3/bin/conda init
    

    Windows

    ./anaconda3/Scripts/conda.exe init
    

    You must launch a new shell or source your init file (e.g., source .bashrc) for the changes to take effect.


    Word of Caution

    This feature remains experimentally supported. I'd recommend running the above command with a --dry-run|-d flag and a verbosity (-vv) flag, in order to see exactly what it would do. If you don't already have a Conda-managed section in your shell run commands file (e.g., .bashrc), then this should appear like a straight-forward insertion of some new lines. If it isn't such a straightforward insertion, I'd recommend clearing any previous Conda sections from $PATH and the relevant shell initialization files (e.g., bashrc) first.


    Alternative shells

    You may need to explicitly identify your shell to Conda. For example, if you run zsh (macOS Catalina default) instead of bash then you would run

    ./anaconda3/bin/conda init zsh
    

    Please see ./anaconda3/bin/conda init --help for a comprehensive list of supported shells.


    Potential Automated Cleanup

    Conda v4.6.9 introduced a --reverse flag that automates removing the changes that are inserted by conda init.

提交回复
热议问题