From the fantasies experienced when smoking an opium pipe.
pipe dream (plural pipe dreams)
(idiomatic) A plan, desire, or idea that will not likely work; a near impossibility.
I think that his plan to have map cases available for this Christmas is a pipe dream.
Pipe nightmare !
A "near impossibility" nevertheless leaves room for possibility...