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

Unable to import phi.torch.flow on macOS #191

Open
sibocw opened this issue Feb 12, 2025 · 2 comments
Open

Unable to import phi.torch.flow on macOS #191

sibocw opened this issue Feb 12, 2025 · 2 comments

Comments

@sibocw
Copy link

sibocw commented Feb 12, 2025

Hello, I'm having trouble running from phi.torch import flow with phiflow 3.2.0 and torch 2.6.0. I'm on a Mac with Apple Silicon chip running macOS Sequoia 15.3. The error message I got was:

$ python
Python 3.12.7 (main, Oct  1 2024, 02:05:46) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from phi.torch import flow
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/username/Library/Caches/pypoetry/virtualenvs/flygym-xZomk8QD-py3.12/lib/python3.12/site-packages/phi/torch/flow.py", line 15, in <module>
    from phi.flow import *
  File "/Users/username/Library/Caches/pypoetry/virtualenvs/flygym-xZomk8QD-py3.12/lib/python3.12/site-packages/phi/flow.py", line 20, in <module>
    from . import geom, field, physics, vis
  File "/Users/username/Library/Caches/pypoetry/virtualenvs/flygym-xZomk8QD-py3.12/lib/python3.12/site-packages/phi/geom/__init__.py", line 22, in <module>
    from ._cylinder import Cylinder, cylinder
  File "/Users/username/Library/Caches/pypoetry/virtualenvs/flygym-xZomk8QD-py3.12/lib/python3.12/site-packages/phi/geom/_cylinder.py", line 7, in <module>
    from phiml.math._magic_ops import all_attributes, getitem_dataclass
ImportError: cannot import name 'getitem_dataclass' from 'phiml.math._magic_ops' (/Users/username/Library/Caches/pypoetry/virtualenvs/flygym-xZomk8QD-py3.12/lib/python3.12/site-packages/phiml/math/_magic_ops.py)

The versions of phiflow and its dependencies are:

pip install phiflow
Requirement already satisfied: phiflow in ./Library/Caches/pypoetry/virtualenvs/flygym-xZomk8QD-py3.12/lib/python3.12/site-packages (3.2.0)
Requirement already satisfied: phiml>=1.10.0 in ./Library/Caches/pypoetry/virtualenvs/flygym-xZomk8QD-py3.12/lib/python3.12/site-packages (from phiflow) (1.12.0)
Requirement already satisfied: matplotlib>=3.5.0 in ./Library/Caches/pypoetry/virtualenvs/flygym-xZomk8QD-py3.12/lib/python3.12/site-packages (from phiflow) (3.10.0)
Requirement already satisfied: packaging in ./Library/Caches/pypoetry/virtualenvs/flygym-xZomk8QD-py3.12/lib/python3.12/site-packages (from phiflow) (24.2)
Requirement already satisfied: contourpy>=1.0.1 in ./Library/Caches/pypoetry/virtualenvs/flygym-xZomk8QD-py3.12/lib/python3.12/site-packages (from matplotlib>=3.5.0->phiflow) (1.3.1)
Requirement already satisfied: cycler>=0.10 in ./Library/Caches/pypoetry/virtualenvs/flygym-xZomk8QD-py3.12/lib/python3.12/site-packages (from matplotlib>=3.5.0->phiflow) (0.12.1)
Requirement already satisfied: fonttools>=4.22.0 in ./Library/Caches/pypoetry/virtualenvs/flygym-xZomk8QD-py3.12/lib/python3.12/site-packages (from matplotlib>=3.5.0->phiflow) (4.55.8)
Requirement already satisfied: kiwisolver>=1.3.1 in ./Library/Caches/pypoetry/virtualenvs/flygym-xZomk8QD-py3.12/lib/python3.12/site-packages (from matplotlib>=3.5.0->phiflow) (1.4.8)
Requirement already satisfied: numpy>=1.23 in ./Library/Caches/pypoetry/virtualenvs/flygym-xZomk8QD-py3.12/lib/python3.12/site-packages (from matplotlib>=3.5.0->phiflow) (1.26.4)
Requirement already satisfied: pillow>=8 in ./Library/Caches/pypoetry/virtualenvs/flygym-xZomk8QD-py3.12/lib/python3.12/site-packages (from matplotlib>=3.5.0->phiflow) (11.1.0)
Requirement already satisfied: pyparsing>=2.3.1 in ./Library/Caches/pypoetry/virtualenvs/flygym-xZomk8QD-py3.12/lib/python3.12/site-packages (from matplotlib>=3.5.0->phiflow) (3.2.1)
Requirement already satisfied: python-dateutil>=2.7 in ./Library/Caches/pypoetry/virtualenvs/flygym-xZomk8QD-py3.12/lib/python3.12/site-packages (from matplotlib>=3.5.0->phiflow) (2.9.0.post0)
Requirement already satisfied: scipy>=1.5.4 in ./Library/Caches/pypoetry/virtualenvs/flygym-xZomk8QD-py3.12/lib/python3.12/site-packages (from phiml>=1.10.0->phiflow) (1.15.1)
Requirement already satisfied: six>=1.5 in ./Library/Caches/pypoetry/virtualenvs/flygym-xZomk8QD-py3.12/lib/python3.12/site-packages (from python-dateutil>=2.7->matplotlib>=3.5.0->phiflow) (1.17.0)

Do you know what might be going on? Thanks in advance for your help!

@sibocw
Copy link
Author

sibocw commented Feb 12, 2025

I think this is related to tum-pbs/PhiML#9.

@Dominic-DallOsto
Copy link

Fixed in e9f5d57

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