Skip to content
项目

关于

Install conda packages on Google Colab, easily

其他项目

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
+1
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

condacolab

Install conda packages on Google Colab, easily.

CondaColab

⚠️ Note: Latest condacolab is now 0.2.x, which revamped the installation mechanism. If you are looking for the legacy Miniforge-driven version, please check the 0.1.x branch.

Basic usage

On your Colab notebook, run the following code as the first executable cell:

!pip install -q --pre condacolab
import condacolab
condacolab.install()

It is important that you perform the installation first thing in the notebook because it will require a kernel restart, thus resetting the variables set up to that point.

This will set up a bare environment with only the essentials to run the Python kernel. If you need more packages, use the dependencies and/or pypi_dependencies arguments. You can also change the default Python version.

# Use Python 3.14
condacolab.install(python_version="3.14")
# Install numpy>=2 and scipy
condacolab.install(dependencies={"numpy": ">=2", "scipy": "*"})

FAQ

Do you have any examples to get started?

Yes, check this example notebook for more information.

How can I use my environment.yml with condacolab?

Neither condacolab nor Pixi support them directly, but here's a one-liner workaround you can run once condacolab.install() has completed:

!pixi exec conda install --file environment.yml --prefix "$CONDA_PREFIX" --yes
# or with micromamba:
!pixi exec micromamba install --file environment.yml --prefix $CONDA_PREFIX --yes

The trick is to know that the restarted kernel runs on an activated conda environment, so you can use $CONDA_PREFIX to refer to it. Do note that any other pixi operations on the environment might undo that operation, so make sure to run this workaround as the last step of the setup.

探索相关项目

加载中…