0%
July 18, 2021

Useful Conda Commands

python

Basic Commands

  • Create an virtual environment:

    conda create --name ENV_NAME python=3.8
  • Remove an virtual environment

    conda env remove -n ENV_NAME
  • Register ENV to jupyter by

    python -m ipykernel install --user --name=ENV_NAME
  • Remove ENV in jupyter by

    jupyter kernelspec uninstall ENV_NAME
  • List all existing virtual environments:

    conda env list
  • List all libraries inside your activated virtual environment:

    conda list
  • Create a requirements.txt

    conda list -e > requirements.txt # for conda
    pip freeze > requirements.txt # for pip
  • conda/pip install the packages in requirements.txt

    conda install --file requirements.txt
    pip install -r requirements.txt

Common Packages

conda install -c conda-forge jupyterlab
conda install -c conda-forge tensorflow
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch