迫不得已

  1. to have no alternative (idiom); compelled by circumstances
  2. forced into sth

“be forced (driven or compelled) to; have no alternative (or choice) but”

被逼得没有办法,不得不这样。

出处 《汉书·王莽传上》:“迫不得已然后受诏。”

示例 他这样做,完全是~。