It should be clear that Islam cares for the dignity and honour of the woman. Because of her weakness and vulnerability to being targeted by vile men, Islam is keen to close the doors to such situations by insisting that a woman should not travel long distances or stay away from home by herself unless she has taken adequate measures to ensure her protection.
The prominent Muslim scholar and da`iZienab Mostafa states: “Nowadays the world has become a small village as the advanced means of transportation have gathered its parts, but we still follow our Islamic teachings. A woman can travel without a mahram if she finds a company of trustworthy people. This applies to performing Hajj or any other travel that is meaningful or is meant to achieve any important aim in her life, such as education or attending an Islamic function like Islamic conferences and international meetings. We can understand this from the Prophet (peace and blessings be upon him) when he promised `Adi ibn Hatim At-Ta’iy (may Allah be pleased with him) three signs when he accepted Islam: that Islam would reach the east and the west; that the companions would obtain the treasures of Kisra, the king of Persia; and that peace would be spread all over the world when Islam reached the east and west so that a woman would be able to travel alone from Yemen to Hadramout not fearing anything but Allah and the wolf, meaning she would fear nothing.
Scholars understand from this hadith that a time will come when women can travel alone when they feel secure.
So, I can say that women can travel alone if the aforementioned conditions are fulfilled. If she really can’t find any mahram to accompany her during the period of study, she can stay alone with good, trustworthy sisters, such as a Muslim hostel for women or any other.”