Cannabis sativa L. has been cultivated and used around the globe for its medicinal properties for millennia1. Some cannabinoids, the hallmark constituents of Cannabis, and their analogues have been investigated extensively for their potential medical applications2. Certain cannabinoid formulations have been approved as prescription drugs in several countries for the treatment of a range of human ailments3. However, the study and medicinal use of cannabinoids has been hampered by the legal scheduling of Cannabis, the low in planta abundances of nearly all of the dozens of known cannabinoids4, and their structural complexity, which limits bulk chemical synthesis. Here we report the complete biosynthesis of the major cannabinoids cannabigerolic acid, Δ9-tetrahydrocannabinolic acid, cannabidiolic acid, Δ9-tetrahydrocannabivarinic acid and cannabidivarinic acid in Saccharomyces cerevisiae, from the simple sugar galactose. To accomplish this, we engineered the native mevalonate pathway to provide a high flux of geranyl pyrophosphate and introduced a heterologous, multi-organism-derived hexanoyl-CoA biosynthetic pathway5. We also introduced the Cannabis genes that encode the enzymes involved in the biosynthesis of olivetolic acid6, as well as the gene for a previously undiscovered enzyme with geranylpyrophosphate:olivetolate geranyltransferase activity and the genes for corresponding cannabinoid synthases7,8. Furthermore, we established a biosynthetic approach that harnessed the promiscuity of several pathway genes to produce cannabinoid analogues. Feeding different fatty acids to our engineered strains yielded cannabinoid analogues with modifications in the part of the molecule that is known to alter receptor binding affinity and potency9. We also demonstrated that our biological system could be complemented by simple synthetic chemistry to further expand the accessible chemical space. Our work presents a platform for the production of natural and unnatural cannabinoids that will allow for more rigorous study of these compounds and could be used in the development of treatments for a variety of human health problems.