Hi I am getting Inflection module not found error...
# general
a
Hi I am getting Inflection module not found error while executing the entry point to run grprc server . The module is mentioned in the build file and was installed using pip install . Still getting error : Module not found
f
Can you provide more context? Are you trying to use remote cache or remote execution (which is hinted at by “grpc”)?
👀 1
a
thanks
@fast-nail-55400
h
Good instinct, Asher. That indeed could be it. FYI this error message comes from Dagster, not from Pants. See https://www.pantsbuild.org/docs/troubleshooting#import-errors-and-missing-dependencies for the general guide on
ModuleNotFoundError
p
so sometimes 3rd party packages don't declare their external dependencies properly. see example: https://github.com/jazzband/django-axes/pull/803 in most case if that other dependency is installed to the virtualenv by other means (maybe the project has direct dependency on it) everything will work. but w/ pants it won't since pants won't see that dependency and hence won't include it.
a
@polite-garden-50641 I already mentioned the dependency in the BUILD file.
p
you can use the pants
dependencies
goal to see all the dependencies (including 3rd parties) that pants see for a given target, this is usually how I debug those issues, see if the inflection package is included in the output of the
dependencies
goal.
a
I have added the inflection dependency in the BUILD file and it gets detected but not showing up in the PEX binary
./pants dependencies :: doesnt show inflection
sorry my bad. @polite-garden-50641 Inflection is showing when i used that ./pants dependencies:: command
h
I have added the inflection dependency in the BUILD file and it gets detected
What do you mean - what did you do?
p
use
./pants dependencies
and give it the pex target instead of
::
i.e.
src/project/thing/foo:my_pex_target_name
a
@hundreds-father-404 what i meant was i externally defined that 3rd party dependency in the build file
@hundreds-father-404 My build file poetry_requirements( name="pyproject", source="pyproject.toml", ) python_sources( name="pipeline", ) pex_binary( name="pipeline-pex", dependencies=[ "//:pyproject", ":pipeline", ], restartable=True,
h
where did you add
inflection
? To your
pyproject.toml
file?
a
@hundreds-father-404 No . In the build file