Objective To investigate the influencing factors of depression and anxiety in patients diagnosed with pulmonary nodules and evaluate the impact of surgery on them.Methods A total of 140 patients diagnosed with pulmonary nodules in the Department of Thoracic Surgery of Beijing Hospital from January 2023 to September 2023 were collected.The general information and personality characteristics of the patients were collected before surgery.The Self-rating Depression Scale(SDS),Self-rating Anxiety Scale(SAS),Pittsburgh Sleep Quality Index(PSQI),concise quality of life and satisfaction questionnaire were used to evaluate the preoperative anxiety,depression,sleep and quality of the patients'lives.The patients were followed up at 1 month,3 months,6 months and 12 months after operation.The postoperative anxiety,depression,sleep quality and quality of life of the patients were evaluated and graded by the above scales,and compared with those before operation.Results A total of 140 patients were included in this study.There were 54 patients(38.6%)with depression,24 patients(17.1%)with anxiety,and 18 patients(12.9%)with depression and anxiety.After multivariate logistic regression analysis,we found that psychoticism(P=0.048)and neuroticism(P=0.009)were risk factors for preoperative depression.They were also risk factors for preoperative anxiety(P=0.006,P=0.007).And there was no significant difference in depression or anxiety between preoperative and postoperative patients.Moreover,the pathological characteristics of the patients were not related to postoperative depression or anxiety in patients.Conclusions Patients with typical neuroticism and psychoticism are associated with depression and anxiety.