package pygraphviz Sagemath 8.6 (W10) [closed]

asked 2019-01-26 20:44:11 +0100

ortollj gravatar image

Hi is it possible to use package pygraphviz in Sagemath 8.6 (W10) ? if yes, how to ?

# Author: Aric Hagberg (

#    Copyright (C) 2004-2018 by
#    Aric Hagberg <>
#    Dan Schult <>
#    Pieter Swart <>
#    All rights reserved.
#    BSD license.

import networkx as nx

# and the following code block is not needed
# but we want to see which module is used and
# if and why it fails
    import pygraphviz
    from networkx.drawing.nx_agraph import write_dot
    print("using package pygraphviz")
except ImportError:
        import pydot
        from networkx.drawing.nx_pydot import write_dot
        print("using package pydot")
    except ImportError:
        print("Both pygraphviz and pydot were not found ")

G = nx.grid_2d_graph(5, 5)  # 5x5 grid
write_dot(G, "")
print("Now run: neato -Tps >")
edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by ortollj
close date 2019-01-27 08:10:25.245687


Oops !, I close this post sorry. :Is this Sage for Windows? If so, it doesn't support installing optional packages yet.

iguananaut answer

I suppose I can only install this package, if I use the Linux VM ?

ortollj gravatar imageortollj ( 2019-01-27 08:09:46 +0100 )edit