As Arshad said in the comments, by just adding kind="count" to the command, it solves the issue. In this case, the code should look like the following.
import pandas as pd
import seaborn as sns
data = pd.read_csv('train.csv')
sns.factorplot('Sex', data=data, kind="count")