如何在 google-colaboratory 上安装需要编译的库

How to install libraries that require compilation on google-colaboratory

尝试安装需要 cmake 的库时,如下所示:

!pip install dlib

笔记本returns出现以下错误:

error: [Errno 2] No such file or directory: 'cmake': 'cmake'

您可以在google-colaboratory上使用apt命令,这样您就可以轻松安装cmake:

!apt update
!apt install -y cmake
!pip install dlib