Modulenotfounderror: No Module Named 'Gspread. Models'

I´m using gspread in Colab and upgraded it to enable the set_timeout option, but now using gspread_dataframe gives the error ModuleNotFoundError: No module named 'gspread.models' Thanks in advance. my Code:

#!pip install gspread --upgrade
#!pip install gspread-dataframe
#!pip install openpyxl

import pandas as pd
import numpy as np
import time
import gspread
from gspread_dataframe import get_as_dataframe, set_with_dataframe
from datetime import datetime
from datetime import timedelta
#from gspread_formatting.dataframe import format_with_dataframe

gspread.__version__
5.2.0
1

2 Answers

Solved!


!pip uninstall gspread-dataframe
    
Successfully uninstalled gspread-dataframe-3.0.8


pip install gspread-dataframe

Successfully installed gspread-dataframe-3.2.2
***
1

For those using gspread directly this error is because in 5.x versions of gspread you should use:

from gspread import Worksheet

instead of

from gspread.models import Worksheet

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article
Twitter Facebook Pinterest