In the present study, a theoretical prediction of the effect of thermal environment on elastic properties of single‐walled carbon nanotubes (SWCNTs) is reported, and a molecular structural mechanics model is proposed in which the covalent bonds are traded as a truss. The influences of the temperature and the coefficient of thermal expansion (CTE) on Young's modulus and shear modulus of both armchair and zigzag SWCNTs are investigated. When CTE is 7.1×10−6K−1 and remains constant, the surface Young's modulus and the normal Young's modulus are reduced, respectively, as compared with the normal temperature. With the change of CTE, its effect on the elastic constant is far greater than the temperature effect itself. According to the principle of elastic theory, a temperature‐dependent continuum shell model of strain energy is also established. The strain energy of single‐walled carbon nanotubes decreases with the increase of the temperature.