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

Updating of loopy make python -c "import firedrake" failed #27

Open
lrtfm opened this issue May 2, 2023 · 2 comments
Open

Updating of loopy make python -c "import firedrake" failed #27

lrtfm opened this issue May 2, 2023 · 2 comments

Comments

@lrtfm
Copy link
Contributor

lrtfm commented May 2, 2023

The command raises the error "ImportError: cannot import name 'CachedCombineMapper' from 'pymbolic.mapper' ". It seems that the new version loopy needs the develop version py-pymbolic and the package py-immutables.

Traceback after install firedrake:

[firedrake-real-int32] [z2yang@ws2 firedrake-real-int32]$ python -c "import firedrake"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/z2yang/opt/firedrake-real-int32/.spack-env/view/lib/python3.10/site-packages/firedrake/__init__.py", line 69, in <module>
    from pyop2 import op2                        # noqa: F401
  File "/home/z2yang/opt/firedrake-real-int32/.spack-env/view/lib/python3.10/site-packages/pyop2/__init__.py", line 4, in <module>
    from pyop2.op2 import *  # noqa
  File "/home/z2yang/opt/firedrake-real-int32/.spack-env/view/lib/python3.10/site-packages/pyop2/op2.py", line 38, in <module>
    from pyop2.configuration import configuration
  File "/home/z2yang/opt/firedrake-real-int32/.spack-env/view/lib/python3.10/site-packages/pyop2/configuration.py", line 38, in <module>
    from loopy.target.c import CWithGNULibcTarget
  File "/home/z2yang/opt/firedrake-real-int32/.spack-env/view/lib/python3.10/site-packages/loopy/__init__.py", line 24, in <module>
    from loopy.symbolic import (
  File "/home/z2yang/opt/firedrake-real-int32/.spack-env/view/lib/python3.10/site-packages/loopy/symbolic.py", line 43, in <module>
    from pymbolic.mapper import (
ImportError: cannot import name 'CachedCombineMapper' from 'pymbolic.mapper' (/home/z2yang/opt/firedrake-real-int32/.spack-env/view/lib/python3.10/site-packages/pymbolic/mapper/__init__.py)

Traceback after installing py-pymbolic@develop:

[firedrake-real-int32] [z2yang@ws2 firedrake-real-int32]$ python -c "import firedrake"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/z2yang/opt/firedrake-real-int32/.spack-env/view/lib/python3.10/site-packages/firedrake/__init__.py", line 69, in <module>
    from pyop2 import op2                        # noqa: F401
  File "/home/z2yang/opt/firedrake-real-int32/.spack-env/view/lib/python3.10/site-packages/pyop2/__init__.py", line 4, in <module>
    from pyop2.op2 import *  # noqa
  File "/home/z2yang/opt/firedrake-real-int32/.spack-env/view/lib/python3.10/site-packages/pyop2/op2.py", line 38, in <module>
    from pyop2.configuration import configuration
  File "/home/z2yang/opt/firedrake-real-int32/.spack-env/view/lib/python3.10/site-packages/pyop2/configuration.py", line 38, in <module>
    from loopy.target.c import CWithGNULibcTarget
  File "/home/z2yang/opt/firedrake-real-int32/.spack-env/view/lib/python3.10/site-packages/loopy/__init__.py", line 24, in <module>
    from loopy.symbolic import (
  File "/home/z2yang/opt/firedrake-real-int32/.spack-env/view/lib/python3.10/site-packages/loopy/symbolic.py", line 52, in <module>
    import immutables
ModuleNotFoundError: No module named 'immutables'
@connorjward
Copy link
Collaborator

Yes immutables is a new dependency of loopy. I forgot when I updated our loopy branch that spack doesn't respect Python declaring dependencies. A new spack package may be needed.

@lrtfm
Copy link
Contributor Author

lrtfm commented May 2, 2023

As spack has package py-immutables, we just need to add it as a dependency.

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

2 participants