Guest User

Untitled

a guest
Nov 20th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. Traceback (most recent call last):
  2. File "/opt/Python-3.6.0/lib/python3.6/tkinter/__init__.py", line 3501, in __del__
  3. self.tk.call('image', 'delete', self.name)
  4. RuntimeError: main thread is not in main loop
  5.  
  6. from time import sleep
  7. import numpy as np
  8. import matplotlib.pyplot as plt
  9. from dask.distributed import Client, LocalCluster
  10.  
  11. if __name__ == '__main__':
  12. cluster = LocalCluster(
  13. n_workers=2,
  14. processes=True,
  15. threads_per_worker=1
  16. )
  17. client = Client(cluster)
  18.  
  19. x = np.linspace(0, 1, 100)
  20. y = x * x
  21. plt.plot(x, y)
  22.  
  23. print('Computation complete! Stopping workers...')
  24. client.close()
  25. sleep(1)
  26. cluster.close()
  27.  
  28. print('Execution complete!')
  29.  
  30. tornado.application - ERROR - Exception in Future <Future cancelled> after timeout
Add Comment
Please, Sign In to add comment