Odeint error for nonlineal differential equations

I receive the following error when I run the code.

ODEintWarning: Excess work done on this call (perhaps wrong Dfun type). Run with full_output = 1 to get quantitative information. warnings.warn(warning_msg, ODEintWarning)

I got this from messing around with an example received from my professor and can't seem to understand what is happening.

%matplotlib inline
import numpy as np

import matplotlib.pyplot as plt
from scipy.integrate import odeint
from scipy.integrate import solve_ivp

def f(y, t):
return y ** 2

t = np.linspace(0, 5, 100)
x0 =  3
x = odeint(f, x0, t)


The exact solution is $$x(t)=\frac{3}{1-3t}.$$ This means that the domain of the solution is $$(-\infty,\frac13)$$. odeint with the integration interval $$[0,5]$$ stalls at this singularity, as it can, correctly, not move beyond this point.