ev3dev-python-tools / ev3dev2simulator

Simulator for an EV3 robot; a program using the ev3dev2 API can run both on the rover and on the simulator without any modifications to the code
MIT License
7 stars 9 forks source link

TypeError when starting simulator #44

Open michielp1807 opened 2 years ago

michielp1807 commented 2 years ago

After installing ev3dev2simulator using pip, running ev3dev2simulator will result in the following error:

Traceback (most recent call last):
  File "/home/michiel/.local/bin/ev3dev2simulator", line 8, in <module>
    sys.exit(main())
  File "/home/michiel/.local/lib/python3.8/site-packages/ev3dev2simulator/__main__.py", line 30, in main
    sys.exit(simmain(orig_path))
  File "/home/michiel/.local/lib/python3.8/site-packages/ev3dev2simulator/simulator.py", line 67, in main
    visualiser = Visualiser(world_simulator.update, world_state, show_fullscreen, show_maximized,
  File "/home/michiel/.local/lib/python3.8/site-packages/ev3dev2simulator/visualisation/visualiser.py", line 42, in __init__
    self.size = Dimensions(get_simulation_settings()['screen_settings']['screen_width'],
  File "/home/michiel/.local/lib/python3.8/site-packages/pyglet/window/__init__.py", line 958, in size
    self.set_size(*new_size)
TypeError: set_size() argument after * must be an iterable, not Dimensions

(I'm using Ubuntu 20.04.5 with Python 3.8.10)

Using an older (pre 2.0.0) version of pyglet seems to fix this problem:

pip3 install pyglet==1.5.27

Maybe the simulator can be updated to pyglet 2.0.0, or maybe the older version of pyglet (i.e. 1.5.27) can be required in setup.py to prevent this issue?