Installing mamba/miniforge and creating virtual environments on Google Colab is a common need, but it can be quite a hassle. Konda solves this problem by helping you do everything with a single command. Essentially, Konda makes mamba installation and usage in Colab straightforward and painless.
There's no learning curve since Konda commands are simply wrappers around mamba commands you already know.
- 🔄 One-command Miniforge Installation: Installs Miniforge with mamba with just one line of code
- 🌐 Built for Google Colab: Optimized for the Colab environment where mamba integration is typically tricky
- 🛠️ Simple Command Wrapper: Run mamba commands without worrying about environment setup
- 🚀 Seamless Environment Activation: Automatically handles the special activation requirements in Colab
- 🧹 Easy Cleanup: Remove the Miniforge installation when you're done
- ⚡ Fast Package Management: Uses mamba for faster dependency resolution and package installation
!pip install kondaimport konda
konda.install()
!conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main
!conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/rKonda is a simple wrapper around mamba.
# Create a new environment
!konda create -n my_env python=3.8 -y
# Activate the environment
!konda activate my_env
# Run a command in the environment
!konda run "mamba install anaconda::tensorflow-gpu=2.4.1 -y"
!konda run "pip install requests"
!konda run "mamba install nvidia/label/cuda-12.4.0::cuda-toolkit"
!konda run "pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124"
# Run a script
!konda run "python my_script.py"
# Deactivate the environment
!konda deactivateTo see how konda works in action, check out the example.
To remove the Miniforge installation created by konda:
konda uninstallTo uninstall the konda package itself:
pip uninstall kondaKonda simplifies mamba management in Google Colab by:
- 📥 Downloading and installing Miniforge in the Colab environment
- 🔧 Setting up the necessary environment paths and variables
- 🔄 Handling the
source ~/conda/etc/profile.d/conda.shandsource ~/conda/etc/profile.d/mamba.shrequirements under the hood - 🚀 Providing a consistent interface for all mamba commands
Contributions are welcome! Here's how you can help:
- 🍴 Fork the repository
- 🔧 Create a feature branch
- 💻 Commit your changes
- 📤 Push to the branch
- 🔄 Open a Pull Request
This project is licensed under the MIT License.
- X: @tamnvvn
- Ko-fi: https://ko-fi.com/tamnguyenvan
- Email: tamnvhustcc@gmail.com
Made with ❤️ to simplify your Colab experience