We consider a generalization of the nonstationary Stokes system, where the
constant viscosity is replaced by a general given positive function. Such a system
arises in many situations as linearized system, when the viscosity of
an incompressible, viscous fluid depends on some other quantities.
We prove unique solvability of the nonstationary system with optimal regularity in $L^q$-Sobolev spaces, in particular for an exterior force $f\in L^q(Q_T)$. Moreover, we characterize the domains of fractional powers of some associated Stokes operators $A_q$
and obtain a corresponding result for $f\in L^q(0,T;\mathcal{D}(A_q^\alpha))$.
The result holds for a general class of domains including bounded domain, exterior domains, aperture domains, infinite cylinder and asymptotically flat layer with $W^{2-\frac1r}_r$-boundary for some $r>d$ with $r\geq \max(q,q')$.