This is because imports are run once. And in your case, the body of your Sidebar class is executed when sidebar.py is parsed, or in other word when you do from sidebar import Sidebar.
You can verify this by removing the line sb = Sidebar() and running your app again. Your sidebar should still appear on the first run.
To fix your issue, what you want to do is this instead: