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

ImportError: cannot import name 'config' from 'jax.config' #549

Closed
namsaraeva opened this issue Feb 29, 2024 · 10 comments · Fixed by #550
Closed

ImportError: cannot import name 'config' from 'jax.config' #549

namsaraeva opened this issue Feb 29, 2024 · 10 comments · Fixed by #550
Labels
bug Something isn't working

Comments

@namsaraeva
Copy link
Collaborator

namsaraeva commented Feb 29, 2024

Report

Bildschirmfoto 2024-02-29 um 19 54 57

scvi-tools were installed from main branch, the environment was brand new. jax was at the latest version.

Version information

No response

@namsaraeva namsaraeva added the bug Something isn't working label Feb 29, 2024
@Zethson Zethson mentioned this issue Mar 1, 2024
@SamuelCWJ
Copy link

Hi! @Zethson Please may I have some assistance with this too? I note that this issue has been closed 3 weeks ago, but it is still happening for me using a fresh install of pertpy.

ImportError Traceback (most recent call last)
Cell In[1], line 9
7 import matplotlib.pyplot as plt
8 import mudata as mu
----> 9 import pertpy as pt

File /scbio4/home/samuel/miniforge3/envs/py3116-env/lib/python3.11/site-packages/pertpy/init.py:19
17 from . import plot as pl
18 from . import preprocessing as pp
---> 19 from . import tools as tl

File /scbio4/home/samuel/miniforge3/envs/py3116-env/lib/python3.11/site-packages/pertpy/tools/init.py:24
22 print("[bold yellow]To use sccoda or tasccoda please install ete3 with [green]pip install ete3")
23 else:
---> 24 raise e

File /scbio4/home/samuel/miniforge3/envs/py3116-env/lib/python3.11/site-packages/pertpy/tools/init.py:18
15 from pertpy.tools._scgen import SCGEN
17 try:
---> 18 from pertpy.tools._coda._sccoda import Sccoda
19 from pertpy.tools._coda._tasccoda import Tasccoda
20 except ImportError as e:

File /scbio4/home/samuel/miniforge3/envs/py3116-env/lib/python3.11/site-packages/pertpy/tools/_coda/_sccoda.py:12
10 from anndata import AnnData
11 from jax import random
---> 12 from jax.config import config
13 from mudata import MuData
14 from numpyro.infer import Predictive

ImportError: cannot import name 'config' from 'jax.config' (/scbio4/home/samuel/miniforge3/envs/py3116-env/lib/python3.11/site-packages/jax/config.py)

Thank you so much!

Best Regards,
Samuel

@SamuelCWJ
Copy link

Hi! @Zethson Please may I have some assistance with this too? I note that this issue has been closed 3 weeks ago, but it is still happening for me using a fresh install of pertpy.

ImportError Traceback (most recent call last) Cell In[1], line 9 7 import matplotlib.pyplot as plt 8 import mudata as mu ----> 9 import pertpy as pt

File /scbio4/home/samuel/miniforge3/envs/py3116-env/lib/python3.11/site-packages/pertpy/init.py:19 17 from . import plot as pl 18 from . import preprocessing as pp ---> 19 from . import tools as tl

File /scbio4/home/samuel/miniforge3/envs/py3116-env/lib/python3.11/site-packages/pertpy/tools/init.py:24 22 print("[bold yellow]To use sccoda or tasccoda please install ete3 with [green]pip install ete3") 23 else: ---> 24 raise e

File /scbio4/home/samuel/miniforge3/envs/py3116-env/lib/python3.11/site-packages/pertpy/tools/init.py:18 15 from pertpy.tools._scgen import SCGEN 17 try: ---> 18 from pertpy.tools._coda._sccoda import Sccoda 19 from pertpy.tools._coda._tasccoda import Tasccoda 20 except ImportError as e:

File /scbio4/home/samuel/miniforge3/envs/py3116-env/lib/python3.11/site-packages/pertpy/tools/_coda/_sccoda.py:12 10 from anndata import AnnData 11 from jax import random ---> 12 from jax.config import config 13 from mudata import MuData 14 from numpyro.infer import Predictive

ImportError: cannot import name 'config' from 'jax.config' (/scbio4/home/samuel/miniforge3/envs/py3116-env/lib/python3.11/site-packages/jax/config.py)

Thank you so much!

Best Regards, Samuel

Hi again, just to update that I managed to solve this by compiling the latest version of pertpy instead of using pip install. Thank you!

@Zethson
Copy link
Member

Zethson commented Mar 20, 2024

Sorry about that. We ll make a release ASAP

@spatts14
Copy link

@SamuelCWJ how do you compile the latest version? I'm hitting the same error.

@SamuelCWJ
Copy link

@SamuelCWJ how do you compile the latest version? I'm hitting the same error.

Hi @spatts14 ,

I followed their instructions here: https://pertpy.readthedocs.io/en/latest/installation.html

$ curl -OJL https://github.com/theislab/pertpy/tarball/master
Extract the files from the tar.gz folder
$ cd (into the extracted folder)
$ pip install .

@Zethson
Copy link
Member

Zethson commented Mar 21, 2024

You can also just git clone the main branch and don't have to download/extract the tar ball.

Again, sorry about this - release ASAP!

@spatts14
Copy link

spatts14 commented Mar 21, 2024

Thank you both! All set now :)

@majmal7
Copy link

majmal7 commented Apr 4, 2024

how to fix this "ImportError: cannot import name 'config' from 'jax.config'"

@majmal7
Copy link

majmal7 commented Apr 4, 2024

@spatts14 @Zethson, how to fix this "ImportError: cannot import name 'config' from 'jax.config'"?

@Zethson
Copy link
Member

Zethson commented Apr 4, 2024

@majmal7 please install from the main branch as outlined here. A new release will happen within the next 3-7 days.

@namsaraeva namsaraeva removed their assignment Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants