Traceback (most recent call last):

 "C:\Users\mjkam\.conda\envs\PyTorch-0\lib\logging\__init__.py", line 1084, in emit
stream.write(msg + self.terminator)AttributeError: 'NoneType' object has no attribute 'write'
Traceback (most recent call last):


 "train_mineral_shards.py", line 51, in <module>

main()


 "train_mineral_shards.py", line 24, in main

visualize=True) as env:


 "/home/zzhang/.local/lib/python3.6/site-packages/pysc2/env/sc2_env.py", line 180, in __init__

static_data = self._controller.data()


 "/home/zzhang/.local/lib/python3.6/site-packages/pysc2/lib/remote_controller.py", line 151, in data

return static_data.StaticData(self.data_raw())


 "/home/zzhang/.local/lib/python3.6/site-packages/pysc2/lib/remote_controller.py", line 80, in _valid_status

return func(self, *args, **kwargs)


 "/home/zzhang/.local/lib/python3.6/site-packages/pysc2/lib/stopwatch.py", line 197, in _stopwatch

return func(*args, **kwargs)


 "/home/zzhang/.local/lib/python3.6/site-packages/pysc2/lib/remote_controller.py", line 147, in data_raw

ability_id=True, unit_type_id=True))


 "/home/zzhang/.local/lib/python3.6/site-packages/pysc2/lib/protocol.py", line 127, in send

res = self.send_req(sc_pb.Request(**kwargs))


 "/home/zzhang/.local/lib/python3.6/site-packages/pysc2/lib/protocol.py", line 113, in send_req

return self.read()


 "/home/zzhang/.local/lib/python3.6/site-packages/pysc2/lib/stopwatch.py", line 197, in _stopwatch

return func(*args, **kwargs)


 "/home/zzhang/.local/lib/python3.6/site-packages/pysc2/lib/protocol.py", line 86, in read

response = self._read()


 "/home/zzhang/.local/lib/python3.6/site-packages/pysc2/lib/protocol.py", line 152, in _read

response_str = self._sock.recv()


 "/usr/lib/python3.6/contextlib.py", line 99, in __exit__

self.gen.throw(type, value, traceback)


 "/home/zzhang/.local/lib/python3.6/site-packages/pysc2/lib/protocol.py", line 63, in catch_websocket_connection_errors

raise ConnectionError("Connection already closed. SC2 probably crashed. "
pysc2.lib.protocol.ConnectionError: Connection already closed. SC2 probably crashed. Check the error log.
