tsorn
tsorn

Reputation: 3625

Why does inspect say that my module is built-in?

mod = importlib.import_module('mortgagecomparison')
inspect.getsourcefile(mod)

Yields:

TypeError: <module 'mortgagecomparison' (namespace)> is a built-in module

But the module is not built-in, it's made by me, then installed a pip install -e ..

Upvotes: 0

Views: 969

Answers (1)

mdurant
mdurant

Reputation: 28683

In the message:

module 'mortgagecomparison' (namespace)

indicates that this is not an imported module or package, just a directory name, presumably without an __init__.py

Upvotes: 3

Related Questions