I did Title: ImportError when running EM waveguide example: cannot import from physicsnemo.sym.hydra
Environment:
- OS: macOS 14.4 (Apple Silicon)
- Python: 3.11.?
- CUDA: N/A (CPU only, Mac)
- PhysicsNeMo version: (output of
pip show nvidia-physicsnemo)
- Installation method:
uv pip install "nvidia-physicsnemo[sym]"
Description:
I am trying to run the EM waveguide example from the PhysicsNeMo repository:
git clone https://github.com/NVIDIA/physicsnemo.git
cd physicsnemo/examples/EM
python waveguide.py
However, the script fails at the import statement on line 9:
from physicsnemo.sym.hydra import to_absolute_path, instantiate_arch, PhysicsNeMoConfig
Error log:
Traceback (most recent call last):
waveguide.py", line 9, in <module>
from physicsnemo.sym.hydra import to_absolute_path, instantiate_arch, PhysicsNeMoConfig
...
From the documentation and source it appears that:
to_absolute_path and instantiate_arch should be available via physicsnemo.sym.hydra docs link,
PhysicsNeMoConfig is defined in physicsnemo.sym.hydra.config. [web:35][web:38][web:41]
So this import line seems to follow the official examples such as helmholtz_ntk.py and heat_sink.py which use:
import physicsnemo.sym
from physicsnemo.sym.hydra import to_absolute_path, instantiate_arch, PhysicsNeMoConfig
[web:36][web:39]
Questions:
- Is this a packaging issue with
nvidia-physicsnemo[sym] on PyPI when used with uv?
- Is there a different recommended import path for
to_absolute_path, instantiate_arch, and PhysicsNeMoConfig in the latest release?
- Are there any known limitations for running the EM examples on macOS / CPU-only environments?
Any guidance or a minimal working example for running examples/EM/waveguide.py with the pip-installed nvidia-physicsnemo[sym] package would be greatly appreciated.
I did Title: ImportError when running EM waveguide example: cannot import from
physicsnemo.sym.hydraEnvironment:
pip show nvidia-physicsnemo)uv pip install "nvidia-physicsnemo[sym]"Description:
I am trying to run the EM waveguide example from the PhysicsNeMo repository:
git clone https://github.com/NVIDIA/physicsnemo.git cd physicsnemo/examples/EM python waveguide.pyHowever, the script fails at the import statement on line 9:
Error log:
From the documentation and source it appears that:
to_absolute_pathandinstantiate_archshould be available viaphysicsnemo.sym.hydradocs link,PhysicsNeMoConfigis defined inphysicsnemo.sym.hydra.config. [web:35][web:38][web:41]So this import line seems to follow the official examples such as
helmholtz_ntk.pyandheat_sink.pywhich use:[web:36][web:39]
Questions:
nvidia-physicsnemo[sym]on PyPI when used withuv?to_absolute_path,instantiate_arch, andPhysicsNeMoConfigin the latest release?Any guidance or a minimal working example for running
examples/EM/waveguide.pywith the pip-installednvidia-physicsnemo[sym]package would be greatly appreciated.