The 29-year-old joins the club ahead of their second County Championship game of the season when they take on Surrey on Friday at 11am BST.
Pretorius spent last summer with Durham and has taken 165 wickets in 65 first-class matches.
He has been named in the Proteas' Test squad for 2020 and their T20 squad a year later but is yet to make his debut.
Somerset director of cricket Andy Hurry stated:
"With Will Sutherland becoming unavailable due to injury, we wanted to make sure that we were able to bring in a similar kind of player."