1import os
2
3def myfun(x):`
4 os.system("pip install shapely")
5 return x
6rdd = sc.parallelize([1,2,3,4]) ## assuming 4 worker nodes
7rdd.map(lambda x: myfun(x)).collect()
8## call each cluster to run the code to import the library
9