conda: the Python environment manager
There are several ways to make
condaruns on your computer. Here are two tastes, Anaconda is a data science toolkit all-in-one edition that makes sure you are ready to go once you have installed it. While MiniForge needs more configurations but it is pure and minimal, the package size is smaller, compared with Anaconda, MiniForge will only install
Alternatively, you can use the command line to install conda:
# Install Homebrew (It takes long time)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install miniforge
# Install choco Package Manager first
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
# Then (in Admin Powershell)
choco install anaconda3
The Linux machine I have provided is already installed
condabinary. If you are now using Linux in lanqiao.cn, the experiment environment is not connected to the Internet so I recommend you install it on your own PC.
Once you have installed the conda, please make sure you can type
condain the CLI. If not,
# path/to/conda refers to conda bin where you have installed
The environment is a collection of Python and its utilities. It enables you to use different versions of Python on one computer. The following command is for creating an environment named
conda create -n pyml python=3.8
-nrefers to specify a name for this environment and
python=3.8refers to this environment needs Python version at 3.8
Then, we can change our current environment to
conda activate pyml
If you are always want to use this environment, you can add this line to your shell config file (
.bashrc), and when you open your shell, the environment is activated automatically.
Have a look at the
You can have a path returned by the last command, and it will like:
That's it, conda can change the
pythonexecutive path whenever you activate an environment.
If you want to delete the environment, use:
conda env remove -n <env_name>