How do we use Concrete-ML on Kaggle?

Since 0.5.1, Concrete-ML supports python>=3.7.1 thus making it possible to run on Kaggle notebook instances, that use python 3.7.12.
To do this simply install Concrete-ML using !pip install concrete-ml in a cell, restart your kernel and it should work.
You will need to activate internet in the Kaggle settings, you might be asked to give your cellphone number.
You can do install and restart automatically using the following code snippet:

try:
    import concrete.ml
except:
    import subprocess
    import IPython
    subprocess.check_output("pip install concrete-ml>=0.5.1", shell=True)
    IPython.Application.instance().kernel.do_shutdown(True) #automatically restarts kernel
4 Likes