Issues setting up gym


I pip installed hlt_client and I authenticated correctly but when I try to run the gym
hlt gym -r "python3" -r "python3" -b "halite" -i 100 -H 240 -W 160
I get this error:

Comparing Bots!
/bin/sh: halite: command not found
Traceback (most recent call last):
File "/usr/local/bin/hlt", line 4, in
File "/usr/local/lib/python3.6/site-packages/hlt_client/", line 224, in main
args.run_commands, args.iterations)
File "/usr/local/lib/python3.6/site-packages/hlt_client/", line 49, in play_games
match_output = playgame(binary, map_width, map_height, bot_commands)
File "/usr/local/lib/python3.6/site-packages/hlt_client/", line 31, in playgame
return subprocess.check_output(game_run_command, shell=True).decode()
File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/", line 336, in check_output
File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '"halite" -d "160 240" -t "python3" "python3"' returned non-zero exit status 127.

It seems it doesn't recognize the binary, but I'm running it from the same directory the halite binary and the 2 bots are stored.


@j-clap can you take a look at this?



chmod a+x halite


It doesn't make any difference. I had tried reinstalling everything but I still got the same error, so I moved the binary to where the hlt_client module is stored and then tried again chmod a+x halite (with and without sudo) but I still get the same error.


Can you run that halite binary by itself?


Yes of course that's what I do every time, but I'd now like to play many games all together, hence the gym.


In -b could you provide the absolute path to where halite is. I believe that might be your issue.


I've already tried different paths but I'll try again


The binary should be where is, right? And I should be running the gym from there


Yesssss!! I finally got it to work. Thank you @j-clap the path was indeed incorrect.
hlt gym -r "python3" -r "python3" --binary "./halite" -i 100 -H 240 -W 160
is the way to go!


what system were you on? i am on a mac and i dont have "hlt"

currently I have tried:

  • ./halite gym -r "python3" -r "python3" -b "./halite" -i 100 -H 240 -W 160
  • hlt gym -r "python3" -r "python3" --binary "./halite" -i 100 -H 240 -W 160
  • ./halite gym -r "python3" "python3" --binary "./halite" -i 100 -H 240 -W 160

to no avail. the errror i get is

PARSE ERROR: Argument: -r (--noreplay)
             Argument already set!

Brief USAGE:
   ./halite  [--log] [--no-compression] [--print-constants]
             [--constantsfile <path to file>] [-i <path to directory>] [-s
             <positive integer>] [-d <a string containing two
             space-seprated positive integers>] [-n <{1,2,3,4,5,6}>] [-r]
             [-t] [-o] [-q] [--] [--version] [-h] <Array of strings> ...

For complete USAGE and HELP type:
   ./halite --help


If you don't have hlt you should install it.
pip3 install hlt_client


this did not work for me but other advice on the Discord helped. very complicated setup if you dont have the dependencies right. also the instructions for gym arent sensitive to OS or alternative setup concerns


Can you post a link that helped you?



just go on the discord. there was no link. the instructions were very poor.

in case it helps future people on Macs my run_gym.bat goes like this:

./hlt_client/hlt_client/ gym -r "python3" -r "python3" -b "./halite" -i 50 -W 240 -H 160

because i installed hlt_client in a subfolder and my halite.exe was in the top level folder. i ran this from the top level.

i think theres some confusion on the forums as theres some instructions to replace with halite. this is wrong and cost me about 1 hr of frustration.