AT A former Hershey’s chocolate factory just outside Ottawa a company called Tweed now produces a rather different confection: marijuana for Canada’s tightly regulated medical market. Under the gaze of surveillance cameras, scientists in lab coats concoct new cannabis-based blends in near-sterile conditions. A repurposed candy mixer does the blending. Only in the growing rooms does the spirit of Cheech and Chong, a stoned comedy duo, seem to preside: the plants have names like Black Widow, Deep Purple, Chem Dawg and Bubba Kush.

The market, though growing fast, is still tiny: just 30,000 registered patients buy their supplies from licensed firms like Tweed (short for therapeutic weed). Its parent company had sales of C$4.2m ($3.1m) in the six months that ended on September 30th. But the promise by Justin Trudeau, Canada’s new prime minister, to legalise marijuana could widen the customer base to well beyond the 3m Canadians thought to consume it now. The government’s first “speech from the throne” on December 4th named legalisation as one of its priorities.

The existence of companies like Tweed, which obtained a stockmarket listing in 2014—long before Mr Trudeau, a tattooed former snowboarding instructor, looked likely to become prime minister—suggests that Canada’s transition from remedial to recreational pot will be smooth. It probably won’t be. “It’s going to be a lot harder to implement than you think,” said Lewis Koski, until recently the director of marijuana enforcement in Colorado, to a Canadian news agency. Colorado is one of four American states to have legalised the drug. Canada, likely to be the first large country to take that step, faces bigger obstacles.

Its legal pot industry got its start in 2001, after courts ruled that sufferers from epilepsy, AIDS, cancer and other ailments had a constitutional right to light up. The federal government of the time, led by Mr Trudeau’s Liberal Party, developed a hybrid system to supply and regulate it. The health ministry acted as dealer and doctor, certifying patients and selling marijuana to them at a subsidised price of C$5 a gram. One company, Prairie Plant Systems, was the ministry’s only supplier. Patients could grow their own, with a licence.

Stephen Harper’s Conservatives, who replaced the Liberals in 2006, abhorred narcotics but couldn’t close the medical-marijuana industry. Instead, they privatised it. Under rules that took effect in April 2014, responsibility for certifying patients passed to doctors and nurses. The government freed prices and licensed 25 tightly regulated private firms, including Tweed, to compete with the sole supplier. They can deliver only by parcel post or to a doctor. Domestic “grow-ops” were outlawed.

These buttoned-up regulations govern just a sliver of the medical-marijuana market; elsewhere, anarchy reigns. The 30,000 registered patients are a small fraction of the 1m people thought to toke for medicinal purposes. Some 25,000 still legally grow their own weed while they await a decision on a lawsuit brought by four home-growers who say they cannot pay the higher prices.

Rather than take delivery by post, many consumers—both patients and partiers—obtain their marijuana through storefront “dispensaries”, which have sprung up across Canada, encouraged by liberalisation in the United States. Vancouver has the liveliest retail sector, with 176 dispensaries, or “compassion clubs”, which buy the surplus produced by home-based herbalists. These hope to become the basis of a legal distribution network.

But unlike Colorado’s distributors of medical marijuana, which became the basis for its recreational retail network, Canada’s dispensaries operate in a treacherous grey zone. REDMED, located on a seedy street in Vancouver’s Gastown district, resembles an indie record shop more than a dispensary. A poster at the till advertises a rap concert. Music-themed T-shirts hang on the walls. Jars labelled Girl Scout Cookies, Crystal Coma and Soccer Mom display the shop’s main merchandise alongside bowls of pretzels and crisps.

Despite appearances, REDMED will not sell it to just anyone hoping to get high. People think they can walk in off the street and buy marijuana, says Jessica Jade, who came in as a patient and now works at the shop. “We can’t just serve you if you don’t have your documents at hand,” she says. Other dispensaries are less fussy.

In June Vancouver’s city council decided to regulate them, even though they remain illegal in the eyes of federal law. Better that than lose the business to Washington state, which has legalised pot and is 90 minutes away by car, the councillors reckoned. Other local authorities—and parts of the marijuana industry—are not so tolerant. Police in Saskatoon, a city in central Saskatchewan, shut down its only storefront dispensary in October. Smokers caught with “a leftover roach” could be charged, they warned.

Legal producers hold the dispensaries and other illegal distributors responsible for their puny sales. If they are sidelined, a stodgier breed of retailer might take over: provincial-owned monopolies that sell alcohol for domestic consumption everywhere except Alberta. Ontario’s is the biggest buyer of booze in North America. The province’s premier, Kathleen Wynne, says it is “very well-suited to putting in place the social-responsibility aspects” of selling marijuana. But the provincial distributors worry that lovers of the bottle will look askance at devotees of the bong. Their chiefs are due to meet in mid-2016 to talk about whether to stock buds of Jamaica Gold alongside Chianti.