Pistacia weinmannifolia is a characteristic species of dry valleys in Southwest China. In this study, 165 presence points of P. weinmannifolia were identified through field surveys, along with point data of 22 environmental factors. The suitable habitat model was formulated using the maximum-entropy (Maxent) algorithm and applied to simulate the potential range of the species in Southwest China, and to project the change of species range in past and future climate scenarios. The results indicate that the Maxent model gave a high accuracy in habitat predictions for P. weinmannifolia. Temperature seasonality, minimum temperature and precipitation were the major constraining climatic factors. Contemporarily, the environment suitable for P. weinmannifolia was located in the dry valleys of major rivers in Southwest China, and the regions was characterized by decreased temperature variability, no temperatures below 0°C, and low precipitation. Simulations using climate scenarios of the Last Inter-Glacial (LIG) and Last Glacial Maximum (LGM) periods indicated that the distribution of P. weinmannifolia was centered around the valleys of major rivers in Southwest China, substantially expanded eastward first, and retreated westward following climate change during glacial and inter-glacial periods, supporting the hypothesis of "glacial out-of-Hengduan Mts.". Under the future climate scenario (2061-2080) with three representative concentration pathways (RCPs), the potential distribution of P. weinmannifolia was projected to migrate eastward to the valleys in the adjacent region of the Yunnan-Guizhou Plateau and Sichuan Basin, and the adjacent region of the Plateau and western Guangxi, reflecting a high possibility of increasing dryness in the river valleys in the future, while its current distribution might disappear. The potential distribution of P. weinmannifolia would decrease by 33% in Southwest China under the future scenario with both RCP2.6 and 4.5, but would increase with RCP8.5.