How to insert an inline image in Google Colaboratory from Google Drive

If you have a link like this, then I’ve got a solution.

https://drive.google.com/file/d/-------/view?usp=sharing
  1. In Google Drive, right-click on the picture
  2. Choose ‘Get a sharable link’

    enter image description here

  3. Click to ‘Copy link’. You need reader permissions. Just need the id of the image.

    enter image description here

In my case my link is:

https://drive.google.com/file/d/1xDrydbSbijvK2JBftUz-5ovagN2B_RWH/view?usp=sharing

Now we need to copy JUST the image id:

1xDrydbSbijvK2JBftUz-5ovagN2B_RWH

We will use this base link to generate your link with the image id:

https://drive.google.com/uc?export=view&id=your_id

We then copy the id in the link:

https://drive.google.com/uc?export=view&id=1xDrydbSbijvK2JBftUz-5ovagN2B_RWH

Finally, to place as an image in Google Colab:

![](https://drive.google.com/uc?export=view&id=1xDrydbSbijvK2JBftUz-5ovagN2B_RWH)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)