harvitronix / reinforcement-learning-car

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

Error importing draw from pymunk.pygame_util #8

Closed mzkhan141 closed 7 years ago

mzkhan141 commented 7 years ago

I wanted to run your code on my window 10 with 32bit python installed but its giving me an ImportError saying cannot import name draw which is occurring on carmunk.py file please help

ghost commented 7 years ago

Hello @mzkhan141 change it to pymunk.pygame_util.DrawOptions

mzkhan141 commented 7 years ago

Hello @Vlad1094 now it says no module named DrawOptions

anthdm commented 7 years ago

This will do the trick.

from pymunk.pygame_util import DrawOptions as draw

anthdm commented 7 years ago

You will get more issues with version > 5.0.0 from pymunk. Solution is pip install pymunk == 4.0.0

harvitronix commented 7 years ago

As @anthdm said, you need to use pymunk 4.

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.

Sandy4321 commented 4 years ago

from pymunk.pygame_util import DrawOptions as draw works thanks but game_state = carmunk.GameState() gives error builtins.NameError: name 'carmunk' is not defined