Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bazel build fails with AttributeError module 'pkgutil' has no attribute 'ImpImporter' #1824

Closed
parthea opened this issue Oct 26, 2023 · 0 comments · Fixed by #1825
Closed

Comments

@parthea
Copy link
Contributor

parthea commented Oct 26, 2023

When building a GAPIC with in a python 3.12 environment, the build fails with AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?. The stack trace is similar to the one in pypa/setuptools#3935. The issue is fixed in setuptools >=66.1.0.

We currently have a pin for setuptools in requirements.txt which is newer than setuptools 66.1.0, however the failure happens before this step.

# The following packages are considered to be unsafe in a requirements file:
setuptools==68.2.2 \
--hash=sha256:4ac1475276d2f1c48684874089fefcd83bd7162ddaafb81fac866ba0db282a87 \
--hash=sha256:b454a35605876da60632df1a60f736524eb73cc47bbc9f3f1ef1b644de74fd2a

There appears to be another pin to an earlier version of setuptools in rules_python. We're currently using rules_python version 0.24.0 which pins setuptools to 60.10.0

_rules_python_version = "0.24.0"
_rules_python_sha256 = "0a8003b044294d7840ac7d9d73eef05d6ceb682d7516781a4ec62eeb34702578"
http_archive(
name = "rules_python",
sha256 = _rules_python_sha256,
strip_prefix = "rules_python-{}".format(_rules_python_version),
url = "https://github.com/bazelbuild/rules_python/archive/{}.tar.gz".format(_rules_python_version),
)

We should upgrade to rules_python version 0.26.0 which pins setuptools to 68.1.2. setuptools version 68.1.2 has the fix for the above AttributeError.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant