reset password
Author Message
RandomAccess
Posts: 101
Posted 11:18 Feb 06, 2020 |

Every time I try to run minority_game.py it gives me the following error:

Traceback (most recent call last):
  File "minority_game.py", line 3, in <module>
    from worker.core.agent import Agent
ModuleNotFoundError: No module named 'worker'

I tried looking up solutions online, but none of them seem to work. Though I did notice that the most common explanation is because it's due to the current version of python not being about to use the "core" module. Any ideas on how to mitigate that? I really don't want to downgrade to a previous version of python.

kmarlis
Posts: 35
Posted 11:33 Feb 06, 2020 |

I've found that some editors have trouble navigating folder structure, which is often where the no model error comes from. VS Code has generally worked for me, whereas Atom continuously gave me those kinds of errors. 

 

Having this at the top of the file also helped in cases where VS Code wasn't enough:

import sys
sys.path.append(".")

Kitcha
Posts: 6
Posted 11:49 Feb 06, 2020 |

I don't think there is a "worker." part in the github file. Maybe change it from 

"from worker.core.agent import Agent" to "from core.agent import Agent"

You might just have an older version.

RandomAccess
Posts: 101
Posted 12:11 Feb 06, 2020 |

Nevermind, Russ Abbott helped me, it works now.