The invention relates to a method for producing an extract from cannabis plant matter, containing tetrahydrocannabinol, cannabidiol and optionally the carboxylic acids thereof. According to said method, the dried plant matter is ground and subjected to a CO2 extraction and the primary extract obtained is separated. The invention method permits Δ8 or Δ9 tetrahydrocannabinol to be selectively obtained both from industrial hemp and from drug-producing hemp, optionally after dissolving the primary extract in ethanol, separating undesirable waxes and removing the solvent under reduced pressure.