One of Google Colab's nice features is the ability to very quickly get a clean environment/session, with all user-installed dependencies removed. A common practice is to put "!pip install x" lines at the top of the notebook, so that when a new session is started, instead of loading up a saved virtual environment, the user can just install required libraries. At the end of the session, the virtual environment is not saved.
I would like to be able to do this in jupyter lab, but short of manually creating a new virtual environment, I'm not sure how to do this.
Does anyone know of a way to emulate a non-persistent virtual environment like this in jupyter lab? So far the best idea I have come up with is just shell commands that create and erase a virtual environment. This isn't super fast with conda (the creation), so now I'm considering just erasing and then re-populating from another location on the file system the contents of the anaconda environment directory with a script. This is the fastest way I can think of to return an environment to a default state, but I'm wondering if there is a cleaner way.