harvitronix / reinforcement-learning-car

Using reinforcement learning to teach a car to avoid obstacles.
MIT License
488 stars 202 forks source link

pymunk.body.apply_impulse #17

Closed kargarisaac closed 7 years ago

kargarisaac commented 7 years ago

When I run the learning.py file, it gives me the " AttributeError: 'Body' object has no attribute 'apply_impulse'" error. which version of pymunk used in the code. how can I fix the problem?

harvitronix commented 7 years ago

This is due to using Pymunk >= 5.

Unfortunately when I wrote this code, Pymunk 4 was the latest, and there were significant changes going to 5.

Quick way to downgrade is: pip3 install pymunk==4.0.0

Then CD into your dist-packages/pymunk and run 2to3 -w *py.

This fixed it for me recently.