Issues setting up gym


#1

I pip installed hlt_client and I authenticated correctly but when I try to run the gym
hlt gym -r "python3 MyBot.py" -r "python3 MyBot_v3.py" -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
client.main()
File "/usr/local/lib/python3.6/site-packages/hlt_client/client.py", line 224, in main
args.run_commands, args.iterations)
File "/usr/local/lib/python3.6/site-packages/hlt_client/compare_bots.py", 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/compare_bots.py", 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/subprocess.py", line 336, in check_output
**kwargs).stdout
File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '"halite" -d "160 240" -t "python3 MyBot.py" "python3 MyBot_v3.py"' 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.


#2

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


#3

Try:

chmod a+x halite


#4

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.


#5

Can you run that halite binary by itself?


#6

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


#7

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


#8

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


#9

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


#10

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


#11

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

currently I have tried:

  • ./halite gym -r "python3 MyBot.py" -r "python3 MyBot.py" -b "./halite" -i 100 -H 240 -W 160
  • hlt gym -r "python3 MyBot.py" -r "python3 MyBot.py" --binary "./halite" -i 100 -H 240 -W 160
  • ./halite gym -r "python3 MyBot.py" "python3 MyBot.py" --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

#12

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


#13

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


#14

Can you post a link that helped you?

Thx


#15

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/client.py gym -r "python3 MyBot.py" -r "python3 MyBot.py" -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 client.py with halite. this is wrong and cost me about 1 hr of frustration.