Use the exact versions dependencies

And remove unused "which" package

Cherry picked from the commit 09ede3d33b1a43c399bc9549c634af634513a81d