Lux-AI-Challenge / Lux-Design-S1

Home to the design and engine of the @Lux-AI-Challenge Season 1, hosted on @kaggle
https://lux-ai.org/
Apache License 2.0
897 stars 152 forks source link

Type Hints in main.py throwing a SyntaxError #148

Closed eytancanzini closed 2 years ago

eytancanzini commented 2 years ago

Hi all,

I'm trying to run the simple/main.py on my local machine to get it working. Every time I run the command sudo npx lux-ai-2021 simple/main.py --width 24 --height 24 on my terminal I get thrown a Syntax error due to the def __init__(self, player-0) -> None: line in main.py. I know its a type hint error but I'm unsure how to fix it. Screenshot from 2021-10-01 10-52-43 I've tried removing the type hint but then the code throws an import error for the typing library. Has anyone got any ideas what's causing the problems? This is just using the simple code downloaded from GitHub, my machine is a Dell Latitude 5510 running Ubuntu 20.04.03 LTS.

agenlu commented 2 years ago

Maybe your version of Python doesn´t have the typing library.

eytancanzini commented 2 years ago

I thought that might be the problem, so I tried installing the typing library but it still throws an ImportError.

eytancanzini commented 2 years ago

Hi all,

I've found the solution, similar to what agenlu said above. The issue was my Python interpreter as I have Conda installed on my machine locally. you need to run something like this: sudo npx lux-ai-2021 --python=/path/to/python simple/main.py simple/main.py --width 24 --height 24 And as long as you have Python 3.7+ installed it should be fine.

I'm closing the issue.