This paper deals with the dynamics of two nonspherical bubbles in a viscous liquid. The governing equations of bubble boundaries are derived by taking account of the translational motion and the deformation of bubbles, and are exact to the first order in perturbation of spherical symmetry for viscous terms. Computations are carried out for both collapsing and growing processes of vapour bubbles. It is shown that the stronger the interaction of bubbles becomes, the more remarkably the effects of viscosity reveal themselves in the early stage of the collapse. Instability on the bubble boundary at the opposite side of another bubble is relieved. It is also shown that the boundary layer around the bubble affects the higher-order distortions from the spherical shape. However, the boundary layer's effects on the translational motion are negligible.