big-fall-51153
05/12/2021, 1:32 PMbuild-support/bin
in pantsbuild/pants
, but having trouble getting it to run. I have the directory in [source].root_patterns
, and a pex_binary
in build-support/bin
but I feel I'm missing something because I get this error:
λ › ./pants run build-support/bin/changelog.py odl/ol-django nl/pants-t2
Traceback (most recent call last):
File "/home/nathan/odl/ol-django/.pants.d/tmpstd0qzkb/changelog.pex/.bootstrap/pex/pex.py", line 489, in execute
File "/home/nathan/odl/ol-django/.pants.d/tmpstd0qzkb/changelog.pex/.bootstrap/pex/pex.py", line 406, in _wrap_coverage
File "/home/nathan/odl/ol-django/.pants.d/tmpstd0qzkb/changelog.pex/.bootstrap/pex/pex.py", line 437, in _wrap_profiling
File "/home/nathan/odl/ol-django/.pants.d/tmpstd0qzkb/changelog.pex/.bootstrap/pex/pex.py", line 545, in _execute
File "/home/nathan/odl/ol-django/.pants.d/tmpstd0qzkb/changelog.pex/.bootstrap/pex/pex.py", line 672, in execute_entry
File "/home/nathan/odl/ol-django/.pants.d/tmpstd0qzkb/changelog.pex/.bootstrap/pex/pex.py", line 684, in execute_module
File "/home/nathan/.pyenv/versions/3.6.10/lib/python3.6/runpy.py", line 201, in run_module
mod_name, mod_spec, code = _get_module_details(mod_name)
File "/home/nathan/.pyenv/versions/3.6.10/lib/python3.6/runpy.py", line 136, in _get_module_details
raise error("No module named %s" % mod_name)
ImportError: No module named changelog
enough-analyst-54434
05/12/2021, 1:47 PMbig-fall-51153
05/12/2021, 1:54 PMenough-analyst-54434
05/12/2021, 1:56 PMpython_library()
at the top of the BUILD file. As you found out - that's critical.
It's also easy to miss because its not clear why you should need to have it. You might be able to save pain going forward (I still often forget to add a python_library) by using ./pants tailor
. More on that here: https://www.pantsbuild.org/docs/troubleshooting#import-errors-and-missing-dependenciesbig-fall-51153
05/12/2021, 2:08 PM