daffidwilde / matching

A package for solving matching games
https://daffidwilde.github.io/matching/
MIT License
152 stars 42 forks source link

No module named 'matching.games'; 'matching' is not a package #176

Closed zadeoglu closed 4 weeks ago

zadeoglu commented 4 weeks ago

Hello, I am trying to use the exact same code in the documentation. I installed 1.4.3 version over pip.

from matching.games import StableMarriage prompts the error No module named 'matching.games'; 'matching' is not a package

Tried also, import matching from matching.games import StableMarriage got the same. Is the names changed somehow? I am just trying to run the code identical to the documentation.

https://daffidwilde.github.io/matching/docs/tutorials/stable_marriage.html

daffidwilde commented 4 weeks ago

Hi @zadeoglu :wave:

If there was something wrong with the package, it would have cropped up during development since matching is doc-tested and the tutorials serve as integration tests. To make sure, I've just made a fresh install of the package on my other half's machine with Python 3.12 and cannot replicate this issue.

Are you sure you've installed the package correctly in whatever environment you're using?

I'm keen to get you up and running :smile:

zadeoglu commented 4 weeks ago

The issue was because I named my file "matching.py" :facepalm:

daffidwilde commented 4 weeks ago

Ah, a sneaky issue! Glad you've resolved it. Have a good one 👍🏼