https://pantsbuild.org/ logo
#general
Title
# general
a

adamant-umbrella-23142

06/17/2022, 4:28 PM
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

fast-nail-55400

06/17/2022, 4:30 PM
Can you provide more context? Are you trying to use remote cache or remote execution (which is hinted at by “grpc”)?
👀 1
a

adamant-umbrella-23142

06/17/2022, 4:37 PM
thanks
@fast-nail-55400
h

hundreds-father-404

06/17/2022, 4:40 PM
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

polite-garden-50641

06/17/2022, 4:42 PM
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

adamant-umbrella-23142

06/17/2022, 4:42 PM
@polite-garden-50641 I already mentioned the dependency in the BUILD file.
p

polite-garden-50641

06/17/2022, 4:44 PM
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

adamant-umbrella-23142

06/17/2022, 4:57 PM
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

hundreds-father-404

06/17/2022, 5:00 PM
I have added the inflection dependency in the BUILD file and it gets detected
What do you mean - what did you do?
p

polite-garden-50641

06/17/2022, 5:02 PM
use
./pants dependencies
and give it the pex target instead of
::
i.e.
src/project/thing/foo:my_pex_target_name
a

adamant-umbrella-23142

06/17/2022, 5:12 PM
@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

hundreds-father-404

06/17/2022, 5:41 PM
where did you add
inflection
? To your
pyproject.toml
file?
a

adamant-umbrella-23142

06/20/2022, 3:55 PM
@hundreds-father-404 No . In the build file