I have also had this bizarre issue and for some strange reason, it was related to importing matplotlib for me.
When matplotlib.pyplot is being imported, then setting num_workers > 0 works with pycharm but gets stuck with bash script.
When I do not import matplotlib, then it works fine.
Not sure what is going on.