Virtual machines wait time after a period of inactivity, so you might want to structure your laptops to install custom dependencies if necessary.
A typical example is the presence of a cell at the top of your laptop, which executes commands aptand pipif necessary.
In the case of opencv, it would look something like this:
!apt install -y -qq libsm6 libxext6 && pip install -q -U opencv-python
(It makes 7 seconds for me on a new virtual machine.)
source
share