Colab 最近升级到 Python 3.9。有一个临时机制供用户运行 Python 3.8 运行时(Linux-5.10.147+-x86_64-with-glibc2.29 平台)。这可以在连接到运行时时通过“使用回退运行时版本”命令从命令面板获得。可以在 here.
跟踪问题正如Scka所说,由于colab更新Python而出现问题
Python 3.7每次都可以在笔记本上安装:使用以下命令:
!sudo apt-get 安装 python3.7
!sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1
!sudo update-alternatives --config python3
!sudo apt 安装 python3-pip
之后
!python --version
然后
!sudo apt-get 安装 python3.7-distutils