meow
meow copied to clipboard
meow installation problem
Hello Floris,
I am trying to run meow, and wanted to let you know if the challenges I encountered. See below. Also the "import meow" line takes quite a long time; maybe there are a lot of large dependancies like gdsfactory?
Thank you
On Mac OSX:
lukasc@Lukass-Air klayout_dot_config % pip install meow-sim --upgrade
Requirement already satisfied: meow-sim in /opt/homebrew/lib/python3.10/site-packages (0.11.0)
...
lukasc@Lukass-Air klayout_dot_config % python
Python 3.10.13 (main, Aug 24 2023, 22:43:20) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import meow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/homebrew/lib/python3.10/site-packages/meow/__init__.py", line 14, in <module>
from .eme import compute_interface_s_matrices as compute_interface_s_matrices
File "/opt/homebrew/lib/python3.10/site-packages/meow/eme/__init__.py", line 10, in <module>
from .sax import compute_s_matrix_sax as compute_s_matrix_sax
File "/opt/homebrew/lib/python3.10/site-packages/meow/eme/sax.py", line 6, in <module>
import sax
File "/opt/homebrew/lib/python3.10/site-packages/sax/__init__.py", line 14, in <module>
from . import backends as backends
File "/opt/homebrew/lib/python3.10/site-packages/sax/backends/__init__.py", line 8, in <module>
from ..netlist import Component
File "/opt/homebrew/lib/python3.10/site-packages/sax/netlist.py", line 13, in <module>
import networkx as nx
File "/opt/homebrew/lib/python3.10/site-packages/networkx/__init__.py", line 100, in <module>
import networkx.classes.filters
File "/opt/homebrew/lib/python3.10/site-packages/networkx/classes/__init__.py", line 1, in <module>
from .graph import Graph
File "/opt/homebrew/lib/python3.10/site-packages/networkx/classes/graph.py", line 23, in <module>
from collections import Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/opt/homebrew/Cellar/[email protected]/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/__init__.py)
>>>
upgrading networkx seemed to help:
lukasc@Lukass-Air klayout_dot_config % pip install networkx --upgrade
Requirement already satisfied: networkx in /opt/homebrew/lib/python3.10/site-packages (2.0)
Collecting networkx
Using cached networkx-3.3-py3-none-any.whl.metadata (5.1 kB)
Using cached networkx-3.3-py3-none-any.whl (1.7 MB)
Installing collected packages: networkx
Attempting uninstall: networkx
Found existing installation: networkx 2.0
Uninstalling networkx-2.0:
Successfully uninstalled networkx-2.0
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
postman-problems 0.3 requires networkx==2.0, but you have networkx 3.3 which is incompatible.
Successfully installed networkx-3.3
but despite having klujax installed, I get the warning:
lukasc@Lukass-Air klayout_dot_config % pip install klujax
Requirement already satisfied: klujax in /opt/homebrew/lib/python3.10/site-packages (0.2.5)
lukasc@Lukass-Air klayout_dot_config % python
Python 3.10.13 (main, Aug 24 2023, 22:43:20) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import meow
/opt/homebrew/lib/python3.10/site-packages/sax/backends/__init__.py:58: UserWarning: klujax not found. Please install klujax for better performance during circuit evaluation!
warnings.warn(
Then on Python 3.11.1:
lukasc@Lukass-Air GitHub % pip install meow-sim --upgrade
Requirement already satisfied: meow-sim in /Users/lukasc/.pyenv/versions/3.11.1/lib/python3.11/site-packages (0.11.0)
...
lukasc@Lukass-Air GitHub % python
Python 3.11.1 (main, Apr 14 2024, 12:39:36) [Clang 15.0.0 (clang-1500.0.40.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import meow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/lukasc/.pyenv/versions/3.11.1/lib/python3.11/site-packages/meow/__init__.py", line 14, in <module>
from .eme import compute_interface_s_matrices as compute_interface_s_matrices
File "/Users/lukasc/.pyenv/versions/3.11.1/lib/python3.11/site-packages/meow/eme/__init__.py", line 10, in <module>
from .sax import compute_s_matrix_sax as compute_s_matrix_sax
File "/Users/lukasc/.pyenv/versions/3.11.1/lib/python3.11/site-packages/meow/eme/sax.py", line 6, in <module>
import sax
File "/Users/lukasc/.pyenv/versions/3.11.1/lib/python3.11/site-packages/sax/__init__.py", line 14, in <module>
from . import backends as backends
File "/Users/lukasc/.pyenv/versions/3.11.1/lib/python3.11/site-packages/sax/backends/__init__.py", line 8, in <module>
from ..netlist import Component
File "/Users/lukasc/.pyenv/versions/3.11.1/lib/python3.11/site-packages/sax/netlist.py", line 22, in <module>
from .utils import clean_string, hash_dict
File "/Users/lukasc/.pyenv/versions/3.11.1/lib/python3.11/site-packages/sax/utils.py", line 26, in <module>
import jax.scipy.linalg
File "/Users/lukasc/.pyenv/versions/3.11.1/lib/python3.11/site-packages/jax/scipy/linalg.py", line 18, in <module>
from jax._src.scipy.linalg import (
File "/Users/lukasc/.pyenv/versions/3.11.1/lib/python3.11/site-packages/jax/_src/scipy/linalg.py", line 403, in <module>
@_wraps(scipy.linalg.tril)
^^^^^^^^^^^^^^^^^
AttributeError: module 'scipy.linalg' has no attribute 'tril'
then I upgrade scipy:
lukasc@Lukass-Air GitHub % pip install scipy --upgrade
Requirement already satisfied: scipy in /Users/lukasc/.pyenv/versions/3.11.1/lib/python3.11/site-packages (1.13.0)
Collecting scipy
Downloading scipy-1.14.0-cp311-cp311-macosx_14_0_arm64.whl.metadata (60 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.8/60.8 kB 1.3 MB/s eta 0:00:00
Requirement already satisfied: numpy<2.3,>=1.23.5 in /Users/lukasc/.pyenv/versions/3.11.1/lib/python3.11/site-packages (from scipy) (1.26.4)
Downloading scipy-1.14.0-cp311-cp311-macosx_14_0_arm64.whl (23.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 23.1/23.1 MB 20.1 MB/s eta 0:00:00
Installing collected packages: scipy
Attempting uninstall: scipy
Found existing installation: scipy 1.13.0
Uninstalling scipy-1.13.0:
Successfully uninstalled scipy-1.13.0
Successfully installed scipy-1.14.0
and get the same error:
File "/Users/lukasc/.pyenv/versions/3.11.1/lib/python3.11/site-packages/jax/_src/scipy/linalg.py", line 403, in <module>
@_wraps(scipy.linalg.tril)
^^^^^^^^^^^^^^^^^
AttributeError: module 'scipy.linalg' has no attribute 'tril'
lukasc@Lukass-Air GitHub % pip install jax --upgrade
Requirement already satisfied: jax in /Users/lukasc/.pyenv/versions/3.11.1/lib/python3.11/site-packages (0.4.23)
Collecting jax
Using cached jax-0.4.30-py3-none-any.whl.metadata (22 kB)
Collecting jaxlib<=0.4.30,>=0.4.27 (from jax)
Downloading jaxlib-0.4.30-cp311-cp311-macosx_11_0_arm64.whl.metadata (1.0 kB)
Requirement already satisfied: ml-dtypes>=0.2.0 in /Users/lukasc/.pyenv/versions/3.11.1/lib/python3.11/site-packages (from jax) (0.4.0)
Requirement already satisfied: numpy>=1.22 in /Users/lukasc/.pyenv/versions/3.11.1/lib/python3.11/site-packages (from jax) (1.26.4)
Requirement already satisfied: opt-einsum in /Users/lukasc/.pyenv/versions/3.11.1/lib/python3.11/site-packages (from jax) (3.3.0)
Requirement already satisfied: scipy>=1.9 in /Users/lukasc/.pyenv/versions/3.11.1/lib/python3.11/site-packages (from jax) (1.14.0)
Using cached jax-0.4.30-py3-none-any.whl (2.0 MB)
Downloading jaxlib-0.4.30-cp311-cp311-macosx_11_0_arm64.whl (66.7 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 66.7/66.7 MB 24.7 MB/s eta 0:00:00
Installing collected packages: jaxlib, jax
Attempting uninstall: jaxlib
Found existing installation: jaxlib 0.4.23
Uninstalling jaxlib-0.4.23:
Successfully uninstalled jaxlib-0.4.23
Attempting uninstall: jax
Found existing installation: jax 0.4.23
Uninstalling jax-0.4.23:
Successfully uninstalled jax-0.4.23
Successfully installed jax-0.4.30 jaxlib-0.4.30
and it works:
lukasc@Lukass-Air GitHub % python
Python 3.11.1 (main, Apr 14 2024, 12:39:36) [Clang 15.0.0 (clang-1500.0.40.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import meow
/Users/lukasc/.pyenv/versions/3.11.1/lib/python3.11/site-packages/sax/backends/__init__.py:58: UserWarning: klujax not found. Please install klujax for better performance during circuit evaluation!
warnings.warn(
>>>
Conclusion: the required dependancies for the meow package should be updated.
thank you Lukas