Firstly, there are numerous grammatical errors in that sentence. Deviate from doesn't seem to be one of these errors. Where would you expect the from to come?
In your subject line, you include "from which deviate." If you're asking, why is it written, "it has to deviate from" as opposed to "from which it has to deviate?" the answer is that deviate from is the normal word order. Changing the order to from which...to deviate would only be necessary to avoid ending a sentence with a preposition; this isn't the end of the sentence, so you needn't reverse the normal order (also the prohibition against ending sentences with prepositions is a silly rule which some of us will not put up with).