Algorithmic decision-making influences everyday life by proposing and automating decisions. Although these models are in general more accurate and reduce the time for decisions, they might result in an unfair decision that discriminates against a person or a group of persons based on properties that are inherited, such as gender or skin colour, or appropriated, such as religion. A common application of machine learning in educational settings is dropout prediction, where one would like to predict whether a student will finish the course so that the decision-maker can intervene and generate dropout prevention policies. In this paper we join the efforts of two tasks, predicting dropout and eliminating unwanted discrimination with regard to gender. We adopt an envy-free point of view on fairness, where every individual prefers the outcome of the algorithm designed for their own group to the outcome of the algorithm designed for any other group. Using envy-freeness as a fairness metric in machine learning is novel, and we propose a penalization function for the envy that might occur in the logistic regression model. The proposed method is applied to the Open University Learning Analytics dataset, predicting whether a student fails or withdraws from a course based on the first sixty days of interaction with course materials and tests.