Packers based on shape memory polymers (SMPs) are an emerging technology that have the advantages of compact structure, easy manufacture, and adaptability to complex wells. This paper proposes a finite element model to simulate the setting process and mechanical response of an SMP packer. The investigated material is an epoxy-based thermal responsive SMP, whose relaxation modulus and thermal expansion coefficient were measured at different temperatures. Based on the experimental data, the model describes the viscoelastic behavior of the SMP using the generalized Maxwell model. The results show that the SMP packer could provide sufficient contact stress under downhole conditions, even after the stress was relaxed. A further parametric study revealed that the most significant factor in sealing effects is the wellbore pressure, followed by the interference between the packer and the annular, the seal length, the pre-compression, and the setting temperature. High downhole pressures require more significant contact stress and increase the risk of slip between the packer and casing wall by promoting shear stress. Increasing the seal length and interference enhances the contact stress and mitigates the shear stress to improve the seal performance. Pre-compression and setting temperatures are minor factors that have little influence on sealability.