OAKLAND, Calif.  For a brief, smoky moment last fall, this economically challenged city seemed poised to become the nation’s most aggressive when it comes to growing and taxing medical marijuana.

Those hopes have been dimmed considerably in recent weeks, though, since an exchange of letters between the city attorney and federal law enforcement officials has made it exceedingly clear that Washington will not tolerate plans for the large-scale marijuana farms the City Council approved last July. City officials had hoped to use the massive indoor growing facilities to raise some $38 million annually in fees and taxes at a time when the city is struggling with a $31 million deficit and 17 percent unemployment.

Polls last summer suggested that voters were likely to pass a November ballot initiative that would have legalized recreational marijuana use in California. They did not. But Oakland decided to proceed with its plans anyway.

Hundreds of well-heeled investors and would-be farmers poured in from across the country to vie for four cultivation permits. Then, in December, just weeks before the city was set to issue the permits, the Council voted to stall the plan after the city’s attorney, John Russo, and a county district attorney warned the Council that the marijuana cultivation ordinance thwarted state law and that city officials could be held criminally liable.