In this work we study the Riemann-Liouville fractional integral of order \(\alpha \in (0,1/p)\) as an operator from \(L^p(I;X)\) into \(L^{q}(I;X)\) , with \(1\le q\le p/(1-p\alpha )\) , whether \(I=[t_0,t_1]\) or \(I=[t_0,\infty )\) and X is a Banach space. Our main result provides necessary and sufficient conditions to ensure the compactness of the Riemann-Liouville fractional integral from \(L^p(t_0,t_1;X)\) into \(L^{q}(t_0,t_1;X)\) , when \(1\le q< p/(1-p\alpha )\) .