How do we resolve import errors caused by modules ...
# general
q
How do we resolve import errors caused by modules that are imported lazily using
apipkg.initpkg(...)
? I get the following error when i run
pants check ::
Copy code
pants.backend.python.dependency_inference.rules.UnownedDependencyError: Pants cannot infer owners for the following imports in the target ...
e
you need to manually add them to
python_source
, see https://www.pantsbuild.org/2.21/reference/targets/python_source#dependencies
q
But all the modules I am importing dynamically are being imported via different module name. would I need to create a
module_mapping
field too in the BUILD files?
e
yeah sounds like it