I was thinking of making a text-based game about detectives, case-solving, with complete freedom, loads of variables, etc. 
But before I get serious with it I need to know how to make rooms. E.g. you start in the hall and you type in "Go kitchen" and you go to the kitchen. 
I have achieved this by using import file when you type in "Go kitchen"  (the file is the kitchen file), but if I want to go back and forth between them it gives an error. 
Is there something I am missing about this method? Is there a better way to do it? The simpler, the better, please.
Do not use import to implement application logic.
In your use case, a room is the classic example of an object in object-oriented programming. You should have a class Room which defines the functionality for rooms. Individual rooms are instances of that class (later you can add subclasses, but I would not worry about that initially).
Your application will have a "current room" as a variable. It will ask the room about its description and display that to the user. When the user types "go Kitchen", your application will ask the current room "hey, do you have a room named 'Kitchen' as a neighbor?" This method will return the appropriate room object, which your application then can set as the current room.
From the above, you can see two functionalities (methods) rooms should have: "Give me your description" and "give me the adjacent room named 'X', if any".
This should get you started.
How best to implement rooms for a text-based game?