Glycans constitute the primary components of proteins that regulate key carcinogenic processes in cancer progression. This study investigated the significance of O-glycan synthesis in the pathogenesis, outcome, and therapy of pancreatic cancer (PC). Transcriptomic data and clinical prognostic information of PC were acquired via TCGA and GEO databases. CSA database was used to obtain single-cell data of PC. The O-glycan biosynthesis signaling pathway and its related genes were acquired via the MSigDB platform. The nonnegative matrix factorization (NMF) clustering was utilized to construct the O-glycan biosynthesis-associated molecular subtypes in PC. The LASSO and Cox regression were utilized to build the prognostic prediction model. We utilized real-time quantitative PCR (qRT-PCR) to verify the expressed levels of model genes. Single-cell analysis was utilized to investigate the levels of target genes and O-glycan biosynthesis signaling pathway in the PC tumour microenvironment. : We obtained 30 genes related to O-glycan biosynthesis, among which 15 were associated with the prognosis of PC. All PC samples were grouped into two distinct molecular subtypes associated with O-glycan biosynthesis: OGRGcluster C1 and OGRGcluster C2, and compared to OGRGcluster C1. PCs in OGRGcluster C2 had a more advanced clinical stage and pathological grade, worse prognosis, and more active O-glycan biosynthesis function. Immune analysis indicated that naïve B cell, CD8+ T cell, memory-activated CD4+ T cell, and monocytes displayed remarkably higher infiltration levels in OGRGcluster C1 while resting NK cell, macrophages M0, resting dendritic cell, activated dendritic cell, and neutrophils exhibited markedly higher infiltration levels in OGRGcluster C2. OGRGcluster C1 exhibited higher sensitivities to drugs, such as cisplatin, irinotecan, KRAS(G12C) inhibitor-12, oxaliplatin, paclitaxel, and sorafenib. Besides, we built the O-glycan biosynthesis-related prognostic model (including SPRR1B, COL17A1, and ECT2) with a good prediction performance. SPRR1B, COL17A1, and ECT2 were remarkably highly expressed in PC tissues and linked to a poor outcome. Single-cell analysis revealed that O-glycan biosynthesis was observed only in PC, and consistent with this, the target genes were significantly enriched in PC. We first constructed molecular subtypes and prognostic models related to O-glycan biosynthesis in PC. It is clear that O-glycan biosynthesis is related to the development, prognosis, immune microenvironment, and treatment of PC. This provides new strategies for stratification, diagnosis, and treatment of PC patients.