PathmindAI / nativerl

Train reinforcement learning agents using AnyLogic or Python-based simulations
Apache License 2.0
19 stars 4 forks source link

Give informative error message when the python env is not found #409

Closed slinlee closed 3 years ago

slinlee commented 3 years ago

We discovered this through a typo, which eventually causes an error in MA with no helpful error message for the user.

Curl cmd:

curl -i -XPOST -H "X-PM-API-TOKEN: ab2c411d-efe2-4e3b-b8b0-09747809e997" \
-F 'file=@/home/malex/Downloads/python_examples.zip' \
-F 'env=exaples.mouse.single_agent_mouse_env.MouseAndCheese' \
-F 'isPathmindSimulation=true' \
http://localhost:8081/py/upload

error: exaples should be examples

Results in:

...
_call_with_frames_removed,   File "<frozen importlib._bootstrap>", line 1006, in _gcd_import,   File "<frozen importlib._bootstrap>", line 983, in _find_and_load,   File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked, ModuleNotFoundError: No module named 'exaples']
slinlee commented 3 years ago

With #467 we'll return a meaningful message on upload.