pysc2 icon indicating copy to clipboard operation
pysc2 copied to clipboard

"Failed to connect to the SC2 websocket. Is it up?"

Open Haoo9988 opened this issue 4 years ago • 4 comments

[user@localhost ~]$ python -m smac.examples.random_agents
/home/user/SMAC/StarCraftII/Versions/Base75689/SC2_x64: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /home/user/SMAC/StarCraftII/Libs/libstdc++.so.6)
WARNING:absl:SC2 isn't running, so bailing early on the websocket connection.
Traceback (most recent call last):
  File "/home/user/.conda/envs/hjy_torch/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/user/.conda/envs/hjy_torch/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/user/.conda/envs/hjy_torch/lib/python3.6/site-packages/smac/examples/random_agents.py", line 43, in <module>
    main()
  File "/home/user/.conda/envs/hjy_torch/lib/python3.6/site-packages/smac/examples/random_agents.py", line 19, in main
    env.reset()
  File "/home/user/.conda/envs/hjy_torch/lib/python3.6/site-packages/smac/env/starcraft2/starcraft2.py", line 347, in reset
    self._launch()
  File "/home/user/.conda/envs/hjy_torch/lib/python3.6/site-packages/smac/env/starcraft2/starcraft2.py", line 297, in _launch
    self._sc2_proc = self._run_config.start(window_size=self.window_size, want_rgb=False)
  File "/home/user/.conda/envs/hjy_torch/lib/python3.6/site-packages/pysc2/run_configs/platforms.py", line 205, in start
    want_rgb=want_rgb, extra_args=extra_args, **kwargs)
  File "/home/user/.conda/envs/hjy_torch/lib/python3.6/site-packages/pysc2/run_configs/platforms.py", line 88, in start
    self, exec_path=exec_path, version=self.version, **kwargs)
  File "/home/user/.conda/envs/hjy_torch/lib/python3.6/site-packages/pysc2/lib/sc_process.py", line 143, in __init__
    self._host, self._port, self, timeout_seconds=timeout_seconds)
  File "/home/user/.conda/envs/hjy_torch/lib/python3.6/site-packages/pysc2/lib/remote_controller.py", line 146, in __init__
    sock = self._connect(host, port, proc, timeout_seconds)
  File "/home/user/.conda/envs/hjy_torch/lib/python3.6/site-packages/pysc2/lib/stopwatch.py", line 212, in _stopwatch
    return func(*args, **kwargs)
  File "/home/user/.conda/envs/hjy_torch/lib/python3.6/site-packages/pysc2/lib/remote_controller.py", line 180, in _connect
    raise ConnectError("Failed to connect to the SC2 websocket. Is it up?")
pysc2.lib.remote_controller.ConnectError: Failed to connect to the SC2 websocket. Is it up?

Can someone tell me how to run SC2?

Haoo9988 avatar Sep 28 '20 13:09 Haoo9988

I"m having the exact same problem, did you ever solve it?

carolinewang01 avatar Nov 20 '20 17:11 carolinewang01

me too

Sud0x67 avatar May 14 '21 13:05 Sud0x67

I found this home/user/SMAC/StarCraftII/Versions/Base75689/SC2_x64: /lib64/libc.so.6: version GLIBC_2.18 not found so serach this problem ,got one solution:

curl -O http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz tar zxf glibc-2.18.tar.gz cd glibc-2.18/ mkdir build cd build/ ../configure --prefix=/usr make -j2 make install

L-Spike avatar Jun 08 '22 03:06 L-Spike

For all future visitors to this issue, my solution might not solve your problem but it solves it for me every time:

export LD_PRELOAD=""

I do this before running my experiments.

EdanToledo avatar May 01 '23 20:05 EdanToledo