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

Missing dependency: pygraphviz? #1

Open
artemiy-dmitriev opened this issue Jan 22, 2022 · 1 comment
Open

Missing dependency: pygraphviz? #1

artemiy-dmitriev opened this issue Jan 22, 2022 · 1 comment

Comments

@artemiy-dmitriev
Copy link

Looks like pygraphviz is required but is not pulled via dependencies during installation (this is on Mac OS):

(finesse3) Artemiis-MacBook-Pro:~ admitriev$ python3
Python 3.8.2 (default, Mar 26 2020, 10:43:30)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from simba import transfer_function_to_graph, tf2rss, adiabatically_eliminate
>>> from sympy import symbols
>>> s = symbols('s')
>>> gamma_f, lmbda = symbols('gamma_f lambda', real=True, positive=True)
>>> tf = (s**2 + s * gamma_f - lmbda) / (s**2 - s * gamma_f - lmbda)
>>> transfer_function_to_graph(tf, 'active_coupled_cavity.png', layout='dot')
0
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/admitriev/miniconda3/envs/finesse3/lib/python3.8/site-packages/simba/graph.py", line 266, in transfer_function_to_graph
    g = nodes_from_dofs(*split_system(ss.to_slh())).as_graphviz_agraph()
  File "/Users/admitriev/miniconda3/envs/finesse3/lib/python3.8/site-packages/simba/graph.py", line 113, in as_graphviz_agraph
    import pygraphviz as pgv
ModuleNotFoundError: No module named 'pygraphviz'

Note that on Mac OS installing pygraphviz via pip requires graphviz to be already installed on the system, which can be done via brew or via conda if the latter is being used. I managed to get a working pygraphviz installation via

conda install graphviz
pip install pygraphviz

After doing that, the example code above worked without errors.

@joebentley
Copy link
Owner

Whoops, I missed this!

requirements.txt and environment.yml both have pygraphviz listed so I'm not sure why it isn't being installed. I'll leave this open

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