Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Module not found" when dependency missing in multi-package build #31

Open
philvarner opened this issue Apr 1, 2022 · 0 comments
Open

Comments

@philvarner
Copy link

I'm not sure if anything needs to be fixed for this issue. A better error message would be nice, and maybe it could be added to the troubleshooting section in the docs. It took me 2 hours to figure out the problem, so I thought I'd at least put this in here in case anyone else runs into the same issue.

The project is https://github.com/stac-utils/stac-fastapi. It has 4 packages in subdirectories, each with it's own setup.py.

The error I was getting after adding a new module file (foobar.py) was:

Module not found: stac_fastapi.types.foobar
ERROR: 1
make: *** [docs] Error 1

This was confusing because the module was there.

The problem turned out to be that I'd inadvertently added a import to this module that was not a dependency of this package's setup.py, but was a dependency of one of the other package's setup.py. This code worked fine when the tests were run because all 4 packages are installed, so the dependency was fulfilled. When pdoc was run, I guess the module didn't load correctly and therefore couldn't be found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant