You should in generally not need to "capture" them, you should be able to just load them from "inside".
As a quite general point, it is worth trying to keep the amount of data that is captured by your automatic lambdas to a minimum.
The specifics here likely depend on how your code is structured - but I'd be surprised if you cannot accomplish what you want here by loading the desired librarires inside and capturing only "data" from the ambient environment.