Ray local cluster error

When I try to run a python script in a local cluster, its throwing python module not found error even though the respective module is installed in all the workers. This error is coming only when I connect to the cluster and run the script for the first time, if I try to re run the same script for the second time, its working fine.