cannot avoid doing; must do; have no choice but to
Expresses that one is compelled to do something due to circumstances, obligation, or social pressure. Follows the negative stem of a verb (e.g., 行かない→行かないわけにはいかない). Often implies reluctance but inevitability.
See also: わけにはいかない
上司に誘われたら、飲み会に行かないわけにはいかない。
If my boss invites me, I can't avoid going to the drinking party.
彼が手伝ってくれたのだから、お礼を
Since he helped me, I must thank him.
The affirmative form わけにはいかない means 'cannot do' due to some reason, while ないわけにはいかない is a double negative meaning 'must do'.
Both express obligation, but ないわけにはいかない emphasizes external circumstances or social pressure, while なければならない is a more general 'must'.
Kanji spelling using 訳 for わけ; less common but seen in formal writing.
Kanji spelling using 行く for いく; rare and may be considered overly literal or archaic.
Mixed kana-kanji spelling; rare and may be seen in older texts.
A double-negative construction: ない (negative) + わけにはいかない (cannot do for some reason). Literally 'it cannot be that I do not do', yielding the meaning 'must do'.