Way to use pygraphviz in cloud?

I am using streamlit_agraph to display a network graph and pygraphviz to add structure to the graph.

When trying to deploy to the cloud I run into an error - is there a way to add pygraphviz to requirements.txt to deploy effectively?:

Error:

× Encountered error while trying to install package.
╰─> pygraphviz

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

Hi @ConnorJames, welcome to the community! :wave: :partying_face:

Here are the official installation instructions for pygraphviz from their docs: Install — PyGraphviz 1.9 documentation

sudo apt-get install graphviz graphviz-dev
pip install pygraphviz

You’ll notice that you first need to install the Linux packages graphviz, and graphviz-dev. As these are apt-get dependencies, they need to be included in a new packages.txt file, not in requirements.txt. Only pygraphviz should be included in your requirements file.

The following entries worked on my fork of your repo:

  1. packages.txt:
    graphviz
    graphviz-dev
    
  2. requirements.txt
    streamlit
    plotly
    streamlit_tags
    streamlit_agraph
    pygraphviz 
    

Best, :balloon:
Snehan

1 Like

Fantastic @snehankekre :wave: :tada: :raised_hands: I am very grateful! Working well and thanks again

1 Like