'google.colab.drive is unsupported in this environment

I am using Colab instance that is connected to Google Cloud to train a neural model using NVIDIA A100-SXM4-40GB.

I want to load my files from my Google Drive but I am not able.

try:
    from google.colab import drive
    drive.mount('/content/drive', force_remount=True)
except Exception as ex:
    print(ex)

When I run the above code I get this error:

google.colab.drive is unsupported in this environment.

What is the problem?

When I try to import my files using a Colab that is not connected to Google Cloud, it works fine.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source