jax-cfd icon indicating copy to clipboard operation
jax-cfd copied to clipboard

[Installation] Failed to import spectral module

Open juliandwain opened this issue 3 years ago • 9 comments

Hi,

Thanks for this amazing library! I installed the module using the command given in the README pip install jax-cfd[complete] to have access to all submodules.

When I try to import the spectral module via import jax_cfd.spectral as spectral I get the following error message:

import jax_cfd.spectral as spectral
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'jax_cfd.spectral'

Some more information about my system and the environment:

  • Python version: Python 3.9.7 (default, Sep 16 2021, 13:09:58)
  • JAX version: 0.2.21
  • JAX CFD version: 0.1.0
  • OS: Linux 5.10.16.3-microsoft-standard-WSL2

Is there any way that I can resolve this issue?

Thanks in advance!

juliandwain avatar Oct 22 '21 07:10 juliandwain

Did you try this: pip install -U git+https://github.com/google/jax-cfd.git? I think that the spectral module is not in a released version (yet).

Hope this helps!

gideonite avatar Oct 22 '21 15:10 gideonite

I haven't tried it yet but I will do so and let you know, thanks for the reply!

juliandwain avatar Oct 22 '21 15:10 juliandwain

Hi @gideonite I tried your command but still got the same error, that there is no module called jax_cfd.spectral.

juliandwain avatar Oct 28 '21 08:10 juliandwain

You might need to try creating a new Python environment, e.g., with Conda?

This works for me in Google Colab:

! pip install -U git+https://github.com/google/jax-cfd.git
import jax_cfd.spectral as spectral

shoyer avatar Oct 29 '21 22:10 shoyer

Thanks @shoyer , this solved my problem!

juliandwain avatar Oct 31 '21 12:10 juliandwain

@shoyer is there a reason why the spectral module is only included if I install the package via

pip install -U git+https://github.com/google/jax-cfd.git

For me, it does still not work if I install it like proposed in the README. (although the above solution does work!)

juliandwain avatar Dec 15 '21 08:12 juliandwain

Yikes sorry for this very very long delay. Did you wind up finding a solution? It may be because the package on PyPI is out of date. @juliandwain

gideonite avatar Mar 29 '22 20:03 gideonite

Installing the package via

pip install -U git+https://github.com/google/jax-cfd.git

does work for me. I was just wondering if its possible to include in the PyPI release so that one does not have to install it via the git command.

juliandwain avatar Mar 30 '22 06:03 juliandwain

We're going to issue a new release shortly after fixing the issues for the channel flow demo

shoyer avatar Mar 31 '22 01:03 shoyer