pkg_tar fails to import gflags when using py3
See original GitHub issueFrom https://github.com/bazelbuild/rules_docker/issues/169
On Linux Ubuntu 14.10 and bazel 0.5.4:
$ bazel build --force_python=py3 --python_path=/usr/bin/python3 :bazel-srcs
INFO: Analysed target //:bazel-srcs (0 packages loaded).
INFO: Found 1 target...
ERROR: /usr/local/google/home/dmarting/git/bazel/BUILD:63:1: error executing shell command: 'bazel-out/host/bin/tools/build_defs/pkg/build_tar --flagfile=bazel-out/local-py3-fastbuild/bin/bazel-srcs.args' failed (Exit 1)
Traceback (most recent call last):
File "/usr/local/google/home/dmarting/.cache/bazel/_bazel_dmarting/4c68128ea7d752c9535d956d14249eea/bazel-sandbox/5414131446493874244/execroot/io_bazel/bazel-out/host/bin/tools/build_defs/pkg/build_tar.runfiles/io_bazel/tools/build_defs/pkg/build_tar.py", line 23, in <module>
from third_party.py import gflags
File "/usr/local/google/home/dmarting/.cache/bazel/_bazel_dmarting/4c68128ea7d752c9535d956d14249eea/bazel-sandbox/5414131446493874244/execroot/io_bazel/bazel-out/host/bin/tools/build_defs/pkg/build_tar.runfiles/io_bazel/third_party/py/gflags/__init__.py", line 1, in <module>
from gflags import *
ImportError: No module named 'gflags'
Target //:bazel-srcs failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.721s, Critical Path: 0.83s
FAILED: Build did NOT complete successfully
$ bazel build :bazel-srcs
INFO: Analysed target //:bazel-srcs (0 packages loaded).
INFO: Found 1 target...
Target //:bazel-srcs up-to-date:
bazel-bin/bazel-srcs.tar
INFO: Elapsed time: 0.867s, Critical Path: 0.03s
INFO: Build completed successfully, 2 total actions
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
python gflags module help flag doesn't work - Stack Overflow
Python gflags does not provide a --help flag. However, the gflags.FLAGS object stringifies to the full help. Use it like this:
Read more >Pacman-mirrors error using downgrade - Manjaro Linux Forum
It appears that pacman-mirrors is called by the downgrade script - which logically shouldn't happen as downgrade is written for Archlinux. I ...
Read more >freecad-git - AUR (en)
Apps trying to use the freecad api fail to find PartDesign since the system is looking in /usr/lib/python3.10/site-packages/ but PartDesign is not installed ......
Read more >Installation from Git sources (master, 5.3rc03) with double ...
I am trying to get a deformable transformation. I am now using Arch (see below) and “regular” compilation flags (as provided by Arch)....
Read more >conda Documentation - Read the Docs for Business
a version of Python 3 built with Visual Studio 2015, which by default does not support Windows XP. You can install Anaconda 2.3.0...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Would it be worth using the newly-released abseil version of gflags directly, rather than importing a local copy: https://github.com/abseil/abseil-py/tree/master/absl/flags ?
The correct thing to do here is move off of gflags entirely, not carry your own copy of the ancient dead code at all. Use absl.flags from https://pypi.org/project/absl-py/.