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

jax dependency error when jax is not installed #188

Closed
jsternabsci opened this issue Mar 6, 2024 · 4 comments
Closed

jax dependency error when jax is not installed #188

jsternabsci opened this issue Mar 6, 2024 · 4 comments

Comments

@jsternabsci
Copy link

jaxtyping 0.2.26 introduced a bug for using the @jaxtyped decorator without jax installed.

Error:

/opt/conda/envs/testenv-20743/lib/python3.11/site-packages/jaxtyping/_decorator.py:192: in jaxtyped
    if _tb_flag and importlib.util.find_spec("jax._src.traceback_util") is not None:
E   ModuleNotFoundError: No module named 'jax'

Breaking change:
v0.2.25...v0.2.26#diff-f792a47fc41c0cf008332f62022e6136a8f6c6e0514c743eedc7df172e519ce5R192

patrick-kidger added a commit that referenced this issue Mar 7, 2024
@patrick-kidger
Copy link
Owner

Thanks for the report! This should be fixed in #188, and I've just done a new release to include this.

@ar0ck
Copy link
Contributor

ar0ck commented Mar 7, 2024

My environment has jax but not jaxlib (don't ask me why 🤔).

This means that importlib.util.find_spec("jax") succeeds, but importlib.util.find_spec("jax._src.traceback_util") fails with ModuleNotFoundError: jax requires jaxlib to be installed..

Thoughts on this? Should jaxtyping verify that jax not only exists, but is import-able? Or it basically just user error to have jax without jaxlib.

@patrick-kidger
Copy link
Owner

Aha! That's unfortunate.
I think we might as well add a check for jaxlib as well. I'd be happy to take a PR on that?

@ar0ck
Copy link
Contributor

ar0ck commented Mar 7, 2024

Will do!

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

No branches or pull requests

3 participants