Is there any way to open kaggle json file from google drive in colab?

Viewed 101

Normally I need to upload kaggle json file for using Kaggle dataset in google colab. And for this, we need to use this code.

!pip install kaggle
from google.colab import files 
files.upload() 

But, I want to upload the json file from google drive. Is it possible? What should I do about this?

!pip install kaggle
from google.colab import files 
files.open('/content/drive/MyDrive/Colab Notebooks/json kaggle')

It gives me an error. and error msg is-

AttributeError                            Traceback (most recent call last)
<ipython-input-2-d57806ba75a7> in <module>()
      1 get_ipython().system('pip install kaggle')
      2 from google.colab import files
----> 3 files.open('/content/drive/MyDrive/Colab Notebooks/json kaggle')
      4 #files.upload() #download and upload json file

AttributeError: module 'google.colab.files' has no attribute 'open'
  

Thank you.

0 Answers
Related