~ないわけにはいかない
Circumstances leave you unable not to do it
You’ll be able to express a strong obligation that comes from the situation rather than a direct rule.

山の日差しがとても強いので、日焼け止めを塗らないわけにはいきません。
yama no hizashi ga totemo tsuyoi node, hiyakedome o nuranai wake ni wa ikimasen.
What do you think this sentence means?
Because the mountain sunlight is so strong, we simply have to put on sunscreen.
Express an unavoidable obligation
~ないわけにはいかない expresses that due to social, moral, or situational circumstances, one cannot avoid doing something ("have to...", "cannot help but...", "must do").
友だちの結婚式だから、出ないわけにはいかない。
tomodachi no kekkonshiki da kara, denai wake ni wa ikanai.
It’s my friend’s wedding, so I can’t not attend.
明日は母の誕生日だから、早く帰らないわけにはいかない。
ashita wa haha no tanjoubi da kara, hayaku kaeranai wake ni wa ikanai.
Tomorrow is my mom’s birthday, so I have to go home early.
Attach ないわけにはいかない to the negative stem
Use the verb ない-form + わけにはいかない. Note that する becomes しないわけにはいかない, and くる becomes こないわけにはいかない.
明日は大事な試験があるので、勉強しないわけにはいかない。
ashita wa daiji na shiken ga aru node, benkyou shinai wake ni wa ikanai.
Since there's an important exam tomorrow, I have no choice but to study.
~わけにはいかない vs ~ないわけにはいかない
After the dictionary form, the pattern says you cannot do something. After the ない-form, the two negatives cancel out: you have to do it.
~わけにはいかない, can’t very well
今日は仕事を休むわけにはいかない。
kyou wa shigoto o yasumu wake ni wa ikanai.
I can’t very well take today off.
Something makes taking the day off unacceptable.
~ないわけにはいかない, have to
今日は仕事を休まないわけにはいかない。
kyou wa shigoto o yasumanai wake ni wa ikanai.
I have no choice but to take today off.
Something makes not taking the day off unacceptable.
隣の人に旅行のお土産をもらったので、お礼を言わないわけにはいかない。
tonari no hito ni ryokou no omiyage o moratta node, orei o iwanai wake ni wa ikanai.
My neighbor gave me a souvenir from their trip, so I have to thank them.
今日は私一人で店をやる日だから、熱があっても店を開けないわけにはいかない。
kyou wa watashi hitori de mise o yaru hi dakara, netsu ga atte mo mise o akenai wake ni wa ikanai.
Today I’m running the shop by myself, so even with a fever I have to open it.
医者に止められたので、たばこをやめないわけにはいかない。
isha ni tomerareta node, tabako o yamenai wake ni wa ikanai.
My doctor told me to stop, so I have no choice but to quit smoking.
7 more examples in the grammar path — free for a limited time.