protocolbuffers / protocolbuffers/protobuf

Bazel: Protobuf v33 (python) requires @system_python

Open
#24,084 20 comments 7 reactions 2 assignees View on GitHub

@rsartor-cmd is already working on this.

Since Aug 14, 2026.

bazel python
Dominant language
C++
Stars
72k
Forks
16.3k
Avg merge
1d 17h
Merged PRs (30d)
140

Description

What version of protobuf and what language are you using?
Version: v33.0/v33.1
Language: C++ (pybind11) + Python
Build System: Bazel 8.4.2 (bzlmod)

What operating system (Linux, Windows, ...) and version?

  • amd64*Linux
  • amd64*MacOS
  • amd64*Windows
  • aarch64*MacOS

ref:

What runtime / compiler are you using (e.g., python version or gcc version)
tested against Python 3.12/3.13

What did you do?
easy to reproduce using this MVE:
https://github.com/Mizux/bazel-pybind11-protobuf (branch mizux/dev)

git clone --depth 1 -b dev https://github.com/Mizux/bazel-pybind11-protobuf
cd bazel-pybind11-protobuf
bazel build //bp11/foo/python:all

What did you expect to see
Build pass

What did you see instead?

ERROR: no such package '@@[unknown repo 'system_python' requested from @@protobuf+]//': The repository '@@[unknown repo 'system_python' requested from @@protobuf+]' could not be resolved: No repository visible as '@system_python' from repository '@@protobuf+'
ERROR: /usr/local/google/home/corentinl/.cache/bazel/_bazel_corentinl/0894f505b0c1ca0afddf1fd7c7733baa/external/protobuf+/python/BUILD.bazel:14:14: no such package '@@[unknown repo 'system_python' requested from @@protobuf+]//': The repository '@@[unknown repo 'system_python' requested from @@protobuf+]' could not be resolved: No repository visible as '@system_python' from repository '@@protobuf+' and referenced by '@@protobuf+//python:proto_api'
ERROR: Analysis of target '//bp11/foo/python:pyfoo_copy_so_to_pyd' failed; build aborted: Analysis failed
INFO: Elapsed time: 2.514s, Critical Path: 0.03s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully

Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).

Anything else we should know about your project / environment

  • perfectly working using Protobuf v32.0 (see main branch).

  • perfectly working using Protobuf v33.0 and CMake based build (see dev branch).

  • https://github.com/Mizux/bazel-proto (no python) Perfectly work against v33.0 on both build Systems...

Spotted some traces of system_python in rules_python 1.7.0 changelog....... which is not released yet !
ref:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.