Many opioid and heroin addicts who otherwise would be homeless have few choices other than to live in seedy flop houses in Philadelphia's most desperate neighborhoods.

Sincere activists are scrambling to fill the ever-growing need to house legions of addicts. But unfortunately, so are opportunists who are profiting from the opioid epidemic.

Staff writer Alfred Lubrano recently reported on the topsy-turvy world of the 4,000 addicts, released inmates, and other people who live in about 200 so-called "recovery" houses in parts of Kensington, Frankford, and North Philadelphia.

Many of the homes are unlicensed, which allows their proprietors to avoid state and city regulations that set minimal standards for habitation. Addicts are crammed into undersized, single-family houses that too often are overrun by bed bugs. In one case, people were living in a dilapidated warehouse.

Some flop houses are run by predatory owners who treat their tenants like exploitable assets by pimping them out to treatment centers that illegally pay them kickbacks to get clients covered by insurance.

Another scam is to put a flop house's utilities in the tenant's names and pocket their disability checks and food stamps to supposedly cover expenses.

Such low-down, dirty tricks take advantage of desperate souls who are battling addiction and mental health problems. Few addicts recover when the help they receive isn't helpful at all.

A knee-jerk reaction would be to immediately shut the flop houses down. But not without figuring out what happens next. The city doesn't want an avalanche of drug addicts, former convicts, and the mentally ill thrown on the streets.

A task force organized by Mayor Kenney recently recommended more safe housing for addicts. Meanwhile, State Sen. Thomas McGarrigle (R., Chester, Delaware) is sponsoring a bill setting housing standards for recovery houses that would impose inspection fees to cover enforcement costs.

But implementing those efforts will take time, and something needs to be done now to provide safe, sanitary housing for people who otherwise will be homeless. Adequate housing should be a component of drug treatment, especially as the opioid epidemic gets worse.

There were 907 fatal drug overdoses in Philadelphia last year, up 29 percent compared with 2015. Death rates were worse in suburbia, rising 54 percent in Chester County (97 deaths) and 51 percent in Montgomery County (230). Statewide, there were 4,652 deaths, a spike of 37 percent, said the Drug Enforcement Administration.

Political leaders from Sen. Robert Casey to Gov. Wolf to Kenney say the opioid crisis is a top priority. If they mean that, they will address flaws in the system that put addicts at the mercy of street scams, which in turn sets back their recovery.

Philadelphia's deplorable flop houses need to be shut down. But first make sure there are viable and immediate alternatives for their desperate occupants. The same federal, state and city public officials who administer Medicaid and other funds to treat addicts need to pay attention to what their clients are calling home.