You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a monorepo using rules_python. During an attempt to bump some of our pypi package versions, many binaries started failing with the following error:
Traceback (most recent call last):
File "/home/jimmy/.cache/bazel/_bazel_jimmy/d34f0b413aad92f69f3e71c957bed2d2/execroot/_main/bazel-out/k8-fastbuild/bin/main.runfiles/_main/main.py", line 1, in<module>
import orbax.checkpoint
^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'orbax.checkpoint'
Importantly, when we run our binaries without Bazel (we're in the process of migrating, so we still have both options) there is no error. So this issue is specific to bazel and rules_python.
For context, we have had issues with the orbax package in the past, it seems to do some weird things with syspath/modules and my guess is that there is a conflict with the way rules_python sets up the virtual environments.
Anything else relevant?
The lastest working version of orbax-checkpoint is 0.10.1. Versions 0.11.1, 0.11.2, 0.11.3, and 0.11.4 have the same error, and versions 0.10.2, 0.10.3, and 0.11.0 also fail but with a slightly different error:
Traceback (most recent call last):
File "/home/jimmy/.cache/bazel/_bazel_jimmy/d34f0b413aad92f69f3e71c957bed2d2/execroot/_main/bazel-out/k8-fastbuild/bin/main.runfiles/_main/main.py", line 1, in<module>
import orbax.checkpoint # noqa: F401
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jimmy/.cache/bazel/_bazel_jimmy/d34f0b413aad92f69f3e71c957bed2d2/execroot/_main/bazel-out/k8-fastbuild/bin/main.runfiles/rules_python~~pip~pip_311_orbax_checkpoint/site-packages/orbax/checkpoint/__init__.py", line 23, in<module>
from orbax.checkpoint import aggregate_handlers
File "/home/jimmy/.cache/bazel/_bazel_jimmy/d34f0b413aad92f69f3e71c957bed2d2/execroot/_main/bazel-out/k8-fastbuild/bin/main.runfiles/rules_python~~pip~pip_311_orbax_checkpoint/site-packages/orbax/checkpoint/aggregate_handlers.py", line 25, in<module>
from orbax.checkpoint import utils
File "/home/jimmy/.cache/bazel/_bazel_jimmy/d34f0b413aad92f69f3e71c957bed2d2/execroot/_main/bazel-out/k8-fastbuild/bin/main.runfiles/rules_python~~pip~pip_311_orbax_checkpoint/site-packages/orbax/checkpoint/utils.py", line 30, in<module>
from orbax.checkpoint._src.path import async_utils
ModuleNotFoundError: No module named 'orbax.checkpoint._src.path'
Commands to run the MRE successfully (without error) outside of Bazel:
Thanks for the fast reply! We do already use aspect_rules_py, which is described as a workaround to #2156. It also fails with the same error, as noted above although re-reading my post I see that could definitely have been made clearer.
Your response sent me on another attempt at investigating though, and I discovered the real problem; google/orbax#1429. They're publishing BUILD files in their wheel.
🐞 bug report
Affected Rule
py_library
,py_binary
,py_test
Is this a regression?
No
Description
We have a monorepo using
rules_python
. During an attempt to bump some of our pypi package versions, many binaries started failing with the following error:Importantly, when we run our binaries without Bazel (we're in the process of migrating, so we still have both options) there is no error. So this issue is specific to bazel and
rules_python
.For context, we have had issues with the
orbax
package in the past, it seems to do some weird things with syspath/modules and my guess is that there is a conflict with the wayrules_python
sets up the virtual environments.🔬 Minimal Reproduction
.bazelversion
:MODULE.bazel
:BUILD.bazel
:requirements.in
:main.py
:🌍 Your Environment
Operating System:
Ubuntu 22.04
Output of
bazel version
:Rules_python version:
1.1.0
Anything else relevant?
The lastest working version of
orbax-checkpoint
is0.10.1
. Versions0.11.1
,0.11.2
,0.11.3
, and0.11.4
have the same error, and versions0.10.2
,0.10.3
, and0.11.0
also fail but with a slightly different error:Commands to run the MRE successfully (without error) outside of Bazel:
uv venv --python 3.11.9 source .venv/bin/activate uv pip sync requirements.txt uv run main.py
The text was updated successfully, but these errors were encountered: