Objective To explore the current status of venous thromboembolism (VTE) in patients with mechanical ventilation, and to analyze its influencing factors based on the random forest model. Methods The clinical data of 263 patients with mechanical ventilation were collected, according to the presence of VTE occurrence, patients were assigned to VTE group or non⁃VTE group, and the univariate analysis was conducted. The random forest model was used to perform importance ranking on variables with statistically significant differences in the univariate analysis, and the variables were screened by the LASSO analysis. The multivariate Logistic regression model was employed to analyze the influencing factors for patients with mechanical ventilation suffering from VTE. Results A total of 62 patients suffered from VTE among 263 patients, resulting in an incidence rate of 23.6%. The results of univariate analysis revealed that there were statistically significant differences in age, length of ICU stay, Acute Physiology and Chronic Health Evaluation Ⅱ score, concomitant hypertension, muscle force, D⁃dimer level, use of sedatives, use of vasoactive drug, mechanical ventilation duration, and fibrinogen level (P<0.05). The results of LASSO analysis indicated that when λ value was 0.0135, the error was the smallest, and the corresponding number of influencing factors was 8. The top 8 important variables in the random forest model with respect to length of ICU stay, mechanical ventilation duration, D⁃dimer level, age, concomitant hypertension, muscle force, fibrinogen level, and use of vasoactive drug were enrolled in the multivariate Logistic regression analysis, and the results interpreted that age, length of ICU stay, and concomitant hypertension were the influencing factors for patients with mechanical ventilation suffering from VTE (P<0.05). Conclusion The incidence rate of VTE is relatively high in patients with mechanical ventilation, therein patients with mechanical ventilation aged≥60 years, with length of ICU stay≥7 days, and those with concomitant hypertension have an increased risk of suffering from VTE.