-
Notifications
You must be signed in to change notification settings - Fork 39
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
No module named 'orbax.checkpoint._src.path'
when used as bazel pip dependency
#1429
Comments
I managed to solve the most immediate issue by removing the Is it intentional that only the following two folders have
Should they be excluded from the wheels? Are they even supposed to exist in the repository? Unfortunately, I'm still unable to use $ bazel run //:pypi_dependency_test
WARNING: Couldn't auto load rules or symbols, because no dependency on module/repository 'rules_android' found. This will result in a failure if there's a reference to those rules or symbols.
INFO: Analyzed target //:pypi_dependency_test (117 packages loaded, 6407 targets configured).
INFO: Found 1 target...
Target //:pypi_dependency_test up-to-date:
bazel-bin/pypi_dependency_test
INFO: Elapsed time: 0.451s, Critical Path: 0.02s
INFO: 1 process: 5 action cache hit, 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: external/bazel_tools/tools/test/test-setup.sh ./pypi_dependency_test
exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //:pypi_dependency_test
-----------------------------------------------------------------------------
Traceback (most recent call last):
File "/private/var/tmp/_bazel/aae0c90911bf9b49b7fec6ebc38b486f/execroot/_main/bazel-out/darwin_arm64-fastbuild/bin/pypi_dependency_test.runfiles/_main/pypi_dependency_test.py", line 3, in <module>
from orbax import checkpoint as ocp
File "/private/var/tmp/_bazel/aae0c90911bf9b49b7fec6ebc38b486f/execroot/_main/bazel-out/darwin_arm64-fastbuild/bin/pypi_dependency_test.runfiles/rules_python++pip+pypi_312_orbax_checkpoint/site-packages/orbax/checkpoint/__init__.py", line 23, in <module>
from orbax.checkpoint import aggregate_handlers
File "/private/var/tmp/_bazel/aae0c90911bf9b49b7fec6ebc38b486f/execroot/_main/bazel-out/darwin_arm64-fastbuild/bin/pypi_dependency_test.runfiles/rules_python++pip+pypi_312_orbax_checkpoint/site-packages/orbax/checkpoint/aggregate_handlers.py", line 26, in <module>
from orbax.checkpoint._src.metadata import tree as tree_metadata
File "/private/var/tmp/_bazel/aae0c90911bf9b49b7fec6ebc38b486f/execroot/_main/bazel-out/darwin_arm64-fastbuild/bin/pypi_dependency_test.runfiles/rules_python++pip+pypi_312_orbax_checkpoint/site-packages/orbax/checkpoint/_src/metadata/tree.py", line 33, in <module>
from orbax.checkpoint._src.metadata import tree_rich_types
File "/private/var/tmp/_bazel/aae0c90911bf9b49b7fec6ebc38b486f/execroot/_main/bazel-out/darwin_arm64-fastbuild/bin/pypi_dependency_test.runfiles/rules_python++pip+pypi_312_orbax_checkpoint/site-packages/orbax/checkpoint/_src/metadata/tree_rich_types.py", line 25, in <module>
from orbax.checkpoint._src.metadata import value_metadata_entry
File "/private/var/tmp/_bazel/aae0c90911bf9b49b7fec6ebc38b486f/execroot/_main/bazel-out/darwin_arm64-fastbuild/bin/pypi_dependency_test.runfiles/rules_python++pip+pypi_312_orbax_checkpoint/site-packages/orbax/checkpoint/_src/metadata/value_metadata_entry.py", line 24, in <module>
from orbax.checkpoint._src.serialization import types
File "/private/var/tmp/_bazel/aae0c90911bf9b49b7fec6ebc38b486f/execroot/_main/bazel-out/darwin_arm64-fastbuild/bin/pypi_dependency_test.runfiles/rules_python++pip+pypi_312_orbax_checkpoint/site-packages/orbax/checkpoint/_src/serialization/types.py", line 32, in <module>
from orbax.checkpoint._src.serialization import serialization
File "/private/var/tmp/_bazel/aae0c90911bf9b49b7fec6ebc38b486f/execroot/_main/bazel-out/darwin_arm64-fastbuild/bin/pypi_dependency_test.runfiles/rules_python++pip+pypi_312_orbax_checkpoint/site-packages/orbax/checkpoint/_src/serialization/serialization.py", line 36, in <module>
from orbax.checkpoint._src.serialization import tensorstore_utils as ts_utils
File "/private/var/tmp/_bazel/aae0c90911bf9b49b7fec6ebc38b486f/execroot/_main/bazel-out/darwin_arm64-fastbuild/bin/pypi_dependency_test.runfiles/rules_python++pip+pypi_312_orbax_checkpoint/site-packages/orbax/checkpoint/_src/serialization/tensorstore_utils.py", line 28, in <module>
import tensorstore as ts
ModuleNotFoundError: No module named 'tensorstore' |
I managed fix the |
There are only two BUILD files because we are in the process of adding more for testing purposes. Probably we could just exclude these from the package published to PyPI since they aren't really necessary for users. |
Excluding the BUILD files from the wheel would be awesome. That would fix the issue. |
I'm trying to use
orbax-checkpoint
as a transitive pip dependency ofbrax
within my bazel setup. I've declaredbrax
, and thus alsoorbax-checkpoint
, as a dependency via pip/pypi. When running any of my bazel targets that depend on the pip-installedorbax-checkpoint
, I getNo module named 'orbax.checkpoint._src.path'
.I created a minimal reproduction here: main...hartikainen:orbax:bazel-pip-dependency-error. And here's the error I get running it:
Does anyone have an idea what might be causing this? I can't reproduce this with other pip systems like vanilla venv or even when creating the venv with
rules_uv
and running python manually through it.The text was updated successfully, but these errors were encountered: