Skip to content

"Relative module names" when importing pex_binary from a bazel git_repository #33

@kyessenov

Description

@kyessenov

Here is what I have in my build file:

pex_binary(
name = "example",
srcs = [
    "@tools//start_esp:fetch_service_config.py",
    "@tools//start_esp:start_esp.py",
],
main = "@tools//start_esp:start_esp.py",
reqs = [
    "certifi",
    "mako>=1.0.4",
    "oauth2client>=3.0.0",
    "pyasn1>=0.1.9",
    "pyasn1-modules>=0.0.8",
    "urllib3>=1.16",
],
)

@tools is an externa repository. Trying to run this gives me an error:

Traceback (most recent call last): File ".bootstrap/_pex/pex.py", line 326, in execute File ".bootstrap/_pex/pex.py", line 258, in _wrap_coverage File ".bootstrap/_pex/pex.py", line 290, in _wrap_profiling File ".bootstrap/_pex/pex.py", line 369, in _execute File ".bootstrap/_pex/pex.py", line 427, in execute_entry File ".bootstrap/_pex/pex.py", line 432, in execute_module File "/usr/lib/python2.7/runpy.py", line 170, in run_module mod_name, loader, code, fname = _get_module_details(mod_name) File "/usr/lib/python2.7/runpy.py", line 101, in _get_module_details loader = get_loader(mod_name) File "/usr/lib/python2.7/pkgutil.py", line 464, in get_loader return find_loader(fullname) File "/usr/lib/python2.7/pkgutil.py", line 474, in find_loader for importer in iter_importers(fullname): File "/usr/lib/python2.7/pkgutil.py", line 425, in iter_importers raise ImportError("Relative module names not supported") ImportError: Relative module names not supported

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions