Repository: networkx/networkx

Issue:
3.2.1: pytest fails in networkx/drawing/tests/test_pylab.py with `module 'matplotlib' has no attribute 'use'`
matplotlib 3.8.3 and pytest fails on scanning units with
```console
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-networkx-3.2.1-5.fc36.x86_64/usr/lib64/python3.9/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-networkx-3.2.1-5.fc36.x86_64/usr/lib/python3.9/site-packages
+ /usr/bin/pytest -ra -m 'not network'
============================= test session starts ==============================
platform linux -- Python 3.9.18, pytest-8.1.1, pluggy-1.4.0
rootdir: /home/tkloczko/rpmbuild/BUILD/networkx-networkx-3.2.1
configfile: pyproject.toml
collected 4831 items / 1 error / 30 skipped

==================================== ERRORS ====================================
____________ ERROR collecting networkx/drawing/tests/test_pylab.py _____________
networkx/drawing/tests/test_pylab.py:10: in <module>
    mpl.use("PS")
E   AttributeError: module 'matplotlib' has no attribute 'use'
=============================== warnings summary ===============================
networkx/utils/backends.py:135
  /home/tkloczko/rpmbuild/BUILD/networkx-networkx-3.2.1/networkx/utils/backends.py:135: RuntimeWarning: networkx backend defined more than once: nx-loopback
    backends.update(_get_backends("networkx.backends"))

networkx/utils/backends.py:576
  /home/tkloczko/rpmbuild/BUILD/networkx-networkx-3.2.1/networkx/utils/backends.py:576: DeprecationWarning:

  random_tree is deprecated and will be removed in NX v3.4
  Use random_labeled_tree instead.
    return self.orig_func(*args, **kwargs)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
```


Discussion:
Also I've tested pytest with networkx/drawing/tests/test_pylab.py added to --ignore list.
Looks like in few units are missing `scipy` marks.
<details>
<summary>Here is pytest output:</summary>

```console
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-networkx-3.2.1-5.fc36.x86_64/usr/lib64/python3.9/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-networkx-3.2.1-5.fc36.x86_64/usr/lib/python3.9/site-packages
+ /usr/bin/pytest -ra -m 'not network' --ignore networkx/drawing/tests/test_pylab.py
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.9.18, pytest-8.1.1, pluggy-1.4.0
rootdir: /home/tkloczko/rpmbuild/BUILD/networkx-networkx-3.2.1
configfile: pyproject.toml
collected 4877 items / 28 skipped

networkx/algorithms/approximation/tests/test_approx_clust_coeff.py ......                                                                                                             [  0%]
networkx/algorithms/approximation/tests/test_clique.py ........                                                                                                                       [  0%]
networkx/algorithms/approximation/tests/test_connectivity.py ..................                                                                                                       [  0%]
networkx/algorithms/approximation/tests/test_distance_measures.py ........                                                                                                            [  0%]
networkx/algorithms/approximation/tests/test_dominating_set.py ....                                                                                                                   [  0%]
networkx/algorithms/approximation/tests/test_kcomponents.py ................                                                                                                          [  1%]
networkx/algorithms/approximation/tests/test_matching.py .                                                                                                                            [  1%]
networkx/algorithms/approximation/tests/test_maxcut.py .....                                                                                                                          [  1%]
networkx/algorithms/approximation/tests/test_ramsey.py .                                                                                                                              [  1%]
networkx/algorithms/approximation/tests/test_steinertree.py ....                                                                                                                      [  1%]
networkx/algorithms/approximation/tests/test_traveling_salesman.py ............................ssssssssss...s.                                                                        [  2%]
networkx/algorithms/approximation/tests/test_treewidth.py ..............                                                                                                              [  2%]
networkx/algorithms/approximation/tests/test_vertex_cover.py ....                                                                                                                     [  2%]
networkx/algorithms/assortativity/tests/test_connectivity.py ..........                                                                                                               [  2%]
networkx/algorithms/assortativity/tests/test_mixing.py ...................                                                                                                            [  3%]
networkx/algorithms/assortativity/tests/test_neighbor_degree.py ......                                                                                                                [  3%]
networkx/algorithms/assortativity/tests/test_pairs.py ...........                                                                                                                     [  3%]
networkx/algorithms/bipartite/tests/test_basic.py ............sss                                                                                                                     [  3%]
networkx/algorithms/bipartite/tests/test_centrality.py .......                                                                                                                        [  4%]
networkx/algorithms/bipartite/tests/test_cluster.py .........                                                                                                                         [  4%]
networkx/algorithms/bipartite/tests/test_covering.py ....                                                                                                                             [  4%]
networkx/algorithms/bipartite/tests/test_edgelist.py ...............                                                                                                                  [  4%]
networkx/algorithms/bipartite/tests/test_extendability.py ...........                                                                                                                 [  4%]
networkx/algorithms/bipartite/tests/test_generators.py ..........                                                                                                                     [  5%]
networkx/algorithms/bipartite/tests/test_matching.py ............ssssssss                                                                                                             [  5%]
networkx/algorithms/bipartite/tests/test_project.py ..................                                                                                                                [  5%]
networkx/algorithms/bipartite/tests/test_redundancy.py ...                                                                                                                            [  5%]
networkx/algorithms/centrality/tests/test_betweenness_centrality.py .........................................                                                                         [  6%]
networkx/algorithms/centrality/tests/test_betweenness_centrality_subset.py ......................                                                                                     [  7%]
networkx/algorithms/centrality/tests/test_closeness_centrality.py .............                                                                                                       [  7%]
networkx/algorithms/centrality/tests/test_degree_centrality.py .......                                                                                                                [  7%]
networkx/algorithms/centrality/tests/test_dispersion.py ....                                                                                                                          [  7%]
networkx/algorithms/centrality/tests/test_group.py ........................                                                                                                           [  8%]
networkx/algorithms/centrality/tests/test_harmonic_centrality.py .............                                                                                                        [  8%]
networkx/algorithms/centrality/tests/test_katz_centrality.py ..........sssssssssss..sss                                                                                               [  9%]
networkx/algorithms/centrality/tests/test_load_centrality.py ..................                                                                                                       [  9%]
networkx/algorithms/centrality/tests/test_percolation_centrality.py ....                                                                                                              [  9%]
networkx/algorithms/centrality/tests/test_reaching.py ...............                                                                                                                 [  9%]
networkx/algorithms/centrality/tests/test_voterank.py ......                                                                                                                          [  9%]
networkx/algorithms/coloring/tests/test_coloring.py .................                                                                                                                 [ 10%]
networkx/algorithms/community/tests/test_asyn_fluid.py .....                                                                                                                          [ 10%]
networkx/algorithms/community/tests/test_centrality.py .....                                                                                                                          [ 10%]
networkx/algorithms/community/tests/test_kclique.py ........                                                                                                                          [ 10%]
networkx/algorithms/community/tests/test_kernighan_lin.py ........                                                                                                                    [ 10%]
networkx/algorithms/community/tests/test_label_propagation.py .......................                                                                                                 [ 11%]
networkx/algorithms/community/tests/test_louvain.py .............                                                                                                                     [ 11%]
networkx/algorithms/community/tests/test_lukes.py ....                                                                                                                                [ 11%]
networkx/algorithms/community/tests/test_modularity_max.py ..................                                                                                                         [ 11%]
networkx/algorithms/community/tests/test_quality.py .......                                                                                                                           [ 12%]
networkx/algorithms/community/tests/test_utils.py ....                                                                                                                                [ 12%]
networkx/algorithms/components/tests/test_attracting.py ....                                                                                                                          [ 12%]
networkx/algorithms/components/tests/test_biconnected.py .............                                                                                                                [ 12%]
networkx/algorithms/components/tests/test_connected.py .........                                                                                                                      [ 12%]
networkx/algorithms/components/tests/test_semiconnected.py ........                                                                                                                   [ 12%]
networkx/algorithms/components/tests/test_strongly_connected.py ..........F..                                                                                                         [ 13%]
networkx/algorithms/components/tests/test_weakly_connected.py ......                                                                                                                  [ 13%]
networkx/algorithms/connectivity/tests/test_connectivity.py ..................................                                                                                        [ 13%]
networkx/algorithms/connectivity/tests/test_cuts.py .....................                                                                                                             [ 14%]
networkx/algorithms/connectivity/tests/test_disjoint_paths.py ..................                                                                                                      [ 14%]
networkx/algorithms/connectivity/tests/test_edge_augmentation.py ....................                                                                                                 [ 15%]
networkx/algorithms/connectivity/tests/test_edge_kcomponents.py .....................                                                                                                 [ 15%]
networkx/algorithms/connectivity/tests/test_kcomponents.py .sss......                                                                                                                 [ 15%]
networkx/algorithms/connectivity/tests/test_kcutsets.py s........s.....                                                                                                               [ 16%]
networkx/algorithms/connectivity/tests/test_stoer_wagner.py .....                                                                                                                     [ 16%]
networkx/algorithms/flow/tests/test_gomory_hu.py ....s....                                                                                                                            [ 16%]
networkx/algorithms/flow/tests/test_maxflow.py ...........................                                                                                                            [ 16%]
networkx/algorithms/flow/tests/test_maxflow_large_graph.py ...s..                                                                                                                     [ 17%]
networkx/algorithms/flow/tests/test_mincost.py ...................                                                                                                                    [ 17%]
networkx/algorithms/flow/tests/test_networksimplex.py ......................                                                                                                          [ 17%]
networkx/algorithms/isomorphism/tests/test_ismags.py ..........                                                                                                                       [ 18%]
networkx/algorithms/isomorphism/tests/test_isomorphism.py ....                                                                                                                        [ 18%]
networkx/algorithms/isomorphism/tests/test_isomorphvf2.py ................                                                                                                            [ 18%]
networkx/algorithms/isomorphism/tests/test_match_helpers.py ..                                                                                                                        [ 18%]
networkx/algorithms/isomorphism/tests/test_temporalisomorphvf2.py ............                                                                                                        [ 18%]
networkx/algorithms/isomorphism/tests/test_tree_isomorphism.py .....                                                                                                                  [ 18%]
networkx/algorithms/isomorphism/tests/test_vf2pp.py ............................................                                                                                      [ 19%]
networkx/algorithms/isomorphism/tests/test_vf2pp_helpers.py .............................................                                                                             [ 20%]
networkx/algorithms/isomorphism/tests/test_vf2userfunc.py ............................                                                                                                [ 21%]
networkx/algorithms/minors/tests/test_contraction.py ...............................                                                                                                  [ 21%]
networkx/algorithms/operators/tests/test_all.py ...................                                                                                                                   [ 22%]
networkx/algorithms/operators/tests/test_binary.py ....................                                                                                                               [ 22%]
networkx/algorithms/operators/tests/test_product.py ............................                                                                                                      [ 23%]
networkx/algorithms/operators/tests/test_unary.py ...                                                                                                                                 [ 23%]
networkx/algorithms/shortest_paths/tests/test_astar.py ................                                                                                                               [ 23%]
networkx/algorithms/shortest_paths/tests/test_dense.py ........                                                                                                                       [ 23%]
networkx/algorithms/shortest_paths/tests/test_dense_numpy.py .......                                                                                                                  [ 24%]
networkx/algorithms/shortest_paths/tests/test_generic.py ..........................                                                                                                   [ 24%]
networkx/algorithms/shortest_paths/tests/test_unweighted.py .................                                                                                                         [ 24%]
networkx/algorithms/shortest_paths/tests/test_weighted.py ........................................................                                                                    [ 26%]
networkx/algorithms/tests/test_asteroidal.py .                                                                                                                                        [ 26%]
networkx/algorithms/tests/test_boundary.py .............                                                                                                                              [ 26%]
networkx/algorithms/tests/test_bridges.py ..........                                                                                                                                  [ 26%]
networkx/algorithms/tests/test_chains.py .....                                                                                                                                        [ 26%]
networkx/algorithms/tests/test_chordal.py ..........                                                                                                                                  [ 26%]
networkx/algorithms/tests/test_clique.py ............                                                                                                                                 [ 27%]
networkx/algorithms/tests/test_cluster.py ...........................................                                                                                                 [ 28%]
networkx/algorithms/tests/test_core.py ...............                                                                                                                                [ 28%]
networkx/algorithms/tests/test_covering.py ...........                                                                                                                                [ 28%]
networkx/algorithms/tests/test_cuts.py .................                                                                                                                              [ 28%]
networkx/algorithms/tests/test_cycles.py ..............................................FF.FF..........                                                                                [ 30%]
networkx/algorithms/tests/test_d_separation.py ...............                                                                                                                        [ 30%]
networkx/algorithms/tests/test_dag.py ............................................................                                                                                    [ 31%]
networkx/algorithms/tests/test_distance_measures.py ..............................................FFFFF.FFFF.....FFFFFFFFFF                                                           [ 33%]
networkx/algorithms/tests/test_distance_regular.py .......                                                                                                                            [ 33%]
networkx/algorithms/tests/test_dominance.py ......................                                                                                                                    [ 33%]
networkx/algorithms/tests/test_dominating.py .....                                                                                                                                    [ 33%]
networkx/algorithms/tests/test_efficiency.py .......                                                                                                                                  [ 33%]
networkx/algorithms/tests/test_euler.py ................................                                                                                                              [ 34%]
networkx/algorithms/tests/test_graph_hashing.py ........................                                                                                                              [ 35%]
networkx/algorithms/tests/test_graphical.py .............                                                                                                                             [ 35%]
networkx/algorithms/tests/test_hierarchy.py .....                                                                                                                                     [ 35%]
networkx/algorithms/tests/test_hybrid.py ..                                                                                                                                           [ 35%]
networkx/algorithms/tests/test_isolate.py ...                                                                                                                                         [ 35%]
networkx/algorithms/tests/test_link_prediction.py .........................................................................                                                           [ 37%]
networkx/algorithms/tests/test_lowest_common_ancestors.py .......................................................                                                                     [ 38%]
networkx/algorithms/tests/test_matching.py ................................................                                                                                           [ 39%]
networkx/algorithms/tests/test_max_weight_clique.py .....                                                                                                                             [ 39%]
networkx/algorithms/tests/test_mis.py .......                                                                                                                                         [ 39%]
networkx/algorithms/tests/test_moral.py .                                                                                                                                             [ 39%]
networkx/algorithms/tests/test_non_randomness.py ......                                                                                                                               [ 39%]
networkx/algorithms/tests/test_planar_drawing.py ............                                                                                                                         [ 39%]
networkx/algorithms/tests/test_planarity.py ..............................                                                                                                            [ 40%]
networkx/algorithms/tests/test_reciprocity.py .....                                                                                                                                   [ 40%]
networkx/algorithms/tests/test_regular.py .............                                                                                                                               [ 40%]
networkx/algorithms/tests/test_richclub.py .........                                                                                                                                  [ 41%]
networkx/algorithms/tests/test_similarity.py sssssssssssssssssssssssssssssssssssssssssssss                                                                                            [ 41%]
networkx/algorithms/tests/test_simple_paths.py ..........................................................................                                                             [ 43%]
networkx/algorithms/tests/test_smallworld.py ......                                                                                                                                   [ 43%]
networkx/algorithms/tests/test_smetric.py ..                                                                                                                                          [ 43%]
networkx/algorithms/tests/test_sparsifiers.py .......                                                                                                                                 [ 43%]
networkx/algorithms/tests/test_structuralholes.py .............                                                                                                                       [ 44%]
networkx/algorithms/tests/test_summarization.py .................                                                                                                                     [ 44%]
networkx/algorithms/tests/test_swap.py .....................                                                                                                                          [ 44%]
networkx/algorithms/tests/test_threshold.py ................s.                                                                                                                        [ 45%]
networkx/algorithms/tests/test_time_dependent.py ............                                                                                                                         [ 45%]
networkx/algorithms/tests/test_tournament.py ...............s.....                                                                                                                    [ 45%]
networkx/algorithms/tests/test_triads.py ................                                                                                                                             [ 46%]
networkx/algorithms/tests/test_vitality.py ......                                                                                                                                     [ 46%]
networkx/algorithms/tests/test_voronoi.py ..........                                                                                                                                  [ 46%]
networkx/algorithms/tests/test_wiener.py ....                                                                                                                                         [ 46%]
networkx/algorithms/traversal/tests/test_beamsearch.py ...                                                                                                                            [ 46%]
networkx/algorithms/traversal/tests/test_bfs.py ...................                                                                                                                   [ 47%]
networkx/algorithms/traversal/tests/test_dfs.py ..................                                                                                                                    [ 47%]
networkx/algorithms/traversal/tests/test_edgebfs.py ................                                                                                                                  [ 47%]
networkx/algorithms/traversal/tests/test_edgedfs.py ...............                                                                                                                   [ 48%]
networkx/algorithms/tree/tests/test_branchings.py ................................                                                                                                    [ 48%]
networkx/algorithms/tree/tests/test_coding.py ..............                                                                                                                          [ 48%]
networkx/algorithms/tree/tests/test_decomposition.py .....                                                                                                                            [ 49%]
networkx/algorithms/tree/tests/test_mst.py ....................................................ssss                                                                                   [ 50%]
networkx/algorithms/tree/tests/test_operations.py ....                                                                                                                                [ 50%]
networkx/algorithms/tree/tests/test_recognition.py .........................                                                                                                          [ 50%]
networkx/classes/tests/test_coreviews.py ........................................................                                                                                     [ 51%]
networkx/classes/tests/test_digraph.py ....................................................................................                                                           [ 53%]
networkx/classes/tests/test_digraph_historical.py ..........................................                                                                                          [ 54%]
networkx/classes/tests/test_filters.py ...........                                                                                                                                    [ 54%]
networkx/classes/tests/test_function.py .......................................................................                                                                       [ 56%]
networkx/classes/tests/test_graph.py ................................................................                                                                                 [ 57%]
networkx/classes/tests/test_graph_historical.py ..................................                                                                                                    [ 58%]
networkx/classes/tests/test_graphviews.py ...................................                                                                                                         [ 58%]
networkx/classes/tests/test_multidigraph.py ......................................................................................................................................... [ 61%]
..................................................                                                                                                                                    [ 62%]
networkx/classes/tests/test_multigraph.py ........................................................................................................................................... [ 65%]
..............                                                                                                                                                                        [ 65%]
networkx/classes/tests/test_reportviews.py .......................................................................................................................................... [ 68%]
.......................................................................................................                                                                               [ 70%]
networkx/classes/tests/test_special.py .............................................................................................................................................. [ 73%]
..................................................................................................................................................................................... [ 77%]
.........................                                                                                                                                                             [ 78%]
networkx/classes/tests/test_subgraphviews.py ................................                                                                                                         [ 78%]
networkx/drawing/tests/test_latex.py ......                                                                                                                                           [ 78%]
networkx/generators/tests/test_atlas.py ........                                                                                                                                      [ 78%]
networkx/generators/tests/test_classic.py ............................................                                                                                                [ 79%]
networkx/generators/tests/test_cographs.py .                                                                                                                                          [ 79%]
networkx/generators/tests/test_community.py ......................                                                                                                                    [ 80%]
networkx/generators/tests/test_degree_seq.py ...................                                                                                                                      [ 80%]
networkx/generators/tests/test_directed.py ..............                                                                                                                             [ 81%]
networkx/generators/tests/test_duplication.py .......                                                                                                                                 [ 81%]
networkx/generators/tests/test_ego.py ..                                                                                                                                              [ 81%]
networkx/generators/tests/test_expanders.py .....sssss................                                                                                                                [ 81%]
networkx/generators/tests/test_geometric.py ..............................                                                                                                            [ 82%]
networkx/generators/tests/test_harary_graph.py ..                                                                                                                                     [ 82%]
networkx/generators/tests/test_internet_as_graphs.py .....                                                                                                                            [ 82%]
networkx/generators/tests/test_intersection.py ....                                                                                                                                   [ 82%]
networkx/generators/tests/test_interval_graph.py ........                                                                                                                             [ 82%]
networkx/generators/tests/test_joint_degree_seq.py ....                                                                                                                               [ 82%]
networkx/generators/tests/test_lattice.py .......................                                                                                                                     [ 83%]
networkx/generators/tests/test_line.py ...................................                                                                                                            [ 84%]
networkx/generators/tests/test_mycielski.py ...                                                                                                                                       [ 84%]
networkx/generators/tests/test_nonisomorphic_trees.py .....                                                                                                                           [ 84%]
networkx/generators/tests/test_random_clustered.py ....                                                                                                                               [ 84%]
networkx/generators/tests/test_random_graphs.py .....................................................................                                                                 [ 85%]
networkx/generators/tests/test_small.py ......................................                                                                                                        [ 86%]
networkx/generators/tests/test_stochastic.py .......                                                                                                                                  [ 86%]
networkx/generators/tests/test_sudoku.py ......                                                                                                                                       [ 86%]
networkx/generators/tests/test_time_series.py .......                                                                                                                                 [ 86%]
networkx/generators/tests/test_trees.py ..................                                                                                                                            [ 87%]
networkx/generators/tests/test_triads.py ..                                                                                                                                           [ 87%]
networkx/linalg/tests/test_algebraic_connectivity.py sssss............ssssssssssssssssssssssssssssssssss.........ssssssssssssssssssssssssssss                                         [ 89%]
networkx/linalg/tests/test_attrmatrix.py ...ss                                                                                                                                        [ 89%]
networkx/readwrite/json_graph/tests/test_adjacency.py ........                                                                                                                        [ 89%]
networkx/readwrite/json_graph/tests/test_cytoscape.py .......                                                                                                                         [ 89%]
networkx/readwrite/json_graph/tests/test_node_link.py ...........                                                                                                                     [ 89%]
networkx/readwrite/json_graph/tests/test_tree.py ...                                                                                                                                  [ 89%]
networkx/readwrite/tests/test_adjlist.py ..................                                                                                                                           [ 90%]
networkx/readwrite/tests/test_edgelist.py ..........................                                                                                                                  [ 90%]
networkx/readwrite/tests/test_gexf.py .....................                                                                                                                           [ 91%]
networkx/readwrite/tests/test_gml.py .........................                                                                                                                        [ 91%]
networkx/readwrite/tests/test_graph6.py ...............................                                                                                                               [ 92%]
networkx/readwrite/tests/test_graphml.py ...........................................................                                                                                  [ 93%]
networkx/readwrite/tests/test_leda.py ..                                                                                                                                              [ 93%]
networkx/readwrite/tests/test_p2g.py ...                                                                                                                                              [ 93%]
networkx/readwrite/tests/test_pajek.py ........                                                                                                                                       [ 93%]
networkx/readwrite/tests/test_sparse6.py ................                                                                                                                             [ 94%]
networkx/readwrite/tests/test_text.py .................................                                                                                                               [ 94%]
networkx/tests/test_all_random_functions.py s                                                                                                                                         [ 94%]
networkx/tests/test_convert.py ...............                                                                                                                                        [ 95%]
networkx/tests/test_convert_numpy.py ..................................................                                                                                               [ 96%]
networkx/tests/test_convert_pandas.py ......................                                                                                                                          [ 96%]
networkx/tests/test_exceptions.py .......                                                                                                                                             [ 96%]
networkx/tests/test_import.py ..                                                                                                                                                      [ 96%]
networkx/tests/test_lazy_imports.py ....                                                                                                                                              [ 96%]
networkx/tests/test_relabel.py ..............................                                                                                                                         [ 97%]
networkx/utils/tests/test__init.py .                                                                                                                                                  [ 97%]
networkx/utils/tests/test_decorators.py ...................................                                                                                                           [ 98%]
networkx/utils/tests/test_heaps.py ..                                                                                                                                                 [ 98%]
networkx/utils/tests/test_mapped_queue.py ..............................................                                                                                              [ 99%]
networkx/utils/tests/test_misc.py ...............................                                                                                                                     [ 99%]
networkx/utils/tests/test_random_sequence.py ....                                                                                                                                     [ 99%]
networkx/utils/tests/test_rcm.py ..                                                                                                                                                   [ 99%]
networkx/utils/tests/test_unionfind.py .....                                                                                                                                          [100%]

========================================================================================= FAILURES ==========================================================================================
________________________________________________________________________ TestStronglyConnected.test_connected_raise _________________________________________________________________________

self = <networkx.algorithms.components.tests.test_strongly_connected.TestStronglyConnected object at 0x7f09dc544430>

    def test_connected_raise(self):
        G = nx.Graph()
        with pytest.raises(NetworkXNotImplemented):
            next(nx.strongly_connected_components(G))
        with pytest.raises(NetworkXNotImplemented):
            next(nx.kosaraju_strongly_connected_components(G))
        with pytest.raises(NetworkXNotImplemented):
            with pytest.deprecated_call():
>               next(nx.strongly_connected_components_recursive(G))

networkx/algorithms/components/tests/test_strongly_connected.py:187:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
<class 'networkx.utils.decorators.argmap'> compilation 498:3: in argmap_strongly_connected_components_recursive_495
    import gzip
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

g = <networkx.classes.graph.Graph object at 0x7f09dab59e20>

    def _not_implemented_for(g):
        if (mval is None or mval == g.is_multigraph()) and (
            dval is None or dval == g.is_directed()
        ):
>           raise nx.NetworkXNotImplemented(errmsg)
E           networkx.exception.NetworkXNotImplemented: not implemented for undirected type

networkx/utils/decorators.py:90: NetworkXNotImplemented

During handling of the above exception, another exception occurred:

self = <networkx.algorithms.components.tests.test_strongly_connected.TestStronglyConnected object at 0x7f09dc544430>

    def test_connected_raise(self):
        G = nx.Graph()
        with pytest.raises(NetworkXNotImplemented):
            next(nx.strongly_connected_components(G))
        with pytest.raises(NetworkXNotImplemented):
            next(nx.kosaraju_strongly_connected_components(G))
        with pytest.raises(NetworkXNotImplemented):
            with pytest.deprecated_call():
>               next(nx.strongly_connected_components_recursive(G))
E               Failed: DID NOT WARN. No warnings of type (<class 'DeprecationWarning'>, <class 'PendingDeprecationWarning'>, <class 'FutureWarning'>) were emitted.
E                Emitted warnings: [].

networkx/algorithms/components/tests/test_strongly_connected.py:187: Failed
_________________________________________________________________________ TestMinimumCycleBasis.test_dimensionality _________________________________________________________________________

self = <networkx.algorithms.tests.test_cycles.TestMinimumCycleBasis object at 0x7f09dbb9aca0>

    def test_dimensionality(self):
        # checks |MCB|=|E|-|V|+|NC|
        ntrial = 10
        for seed in range(1234, 1234 + ntrial):
            rg = nx.erdos_renyi_graph(10, 0.3, seed=seed)
            nnodes = rg.number_of_nodes()
            nedges = rg.number_of_edges()
            ncomp = nx.number_connected_components(rg)

            mcb = nx.minimum_cycle_basis(rg)
            assert len(mcb) == nedges - nnodes + ncomp
>           check_independent(mcb)

networkx/algorithms/tests/test_cycles.py:883:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
networkx/algorithms/tests/test_cycles.py:22: in check_independent
    inc = nx.incidence_matrix(H, oriented=True)
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

G = <networkx.classes.graph.Graph object at 0x7f09d913e670>, nodelist = None, edgelist = None, oriented = True, weight = None

    @nx._dispatch(edge_attrs="weight")
    def incidence_matrix(
        G, nodelist=None, edgelist=None, oriented=False, weight=None, *, dtype=None
    ):
        """Returns incidence matrix of G.

        The incidence matrix assigns each row to a node and each column to an edge.
        For a standard incidence matrix a 1 appears wherever a row's node is
        incident on the column's edge.  For an oriented incidence matrix each
        edge is assigned an orientation (arbitrarily for undirected and aligning to
        direction for directed).  A -1 appears for the source (tail) of an edge and
        1 for the destination (head) of the edge.  The elements are zero otherwise.

        Parameters
        ----------
        G : graph
           A NetworkX graph

        nodelist : list, optional   (default= all nodes in G)
           The rows are ordered according to the nodes in nodelist.
           If nodelist is None, then the ordering is produced by G.nodes().

        edgelist : list, optional (default= all edges in G)
           The columns are ordered according to the edges in edgelist.
           If edgelist is None, then the ordering is produced by G.edges().

        oriented: bool, optional (default=False)
           If True, matrix elements are +1 or -1 for the head or tail node
           respectively of each edge.  If False, +1 occurs at both nodes.

        weight : string or None, optional (default=None)
           The edge data key used to provide each value in the matrix.
           If None, then each edge has weight 1.  Edge weights, if used,
           should be positive so that the orientation can provide the sign.

        dtype : a NumPy dtype or None (default=None)
            The dtype of the output sparse array. This type should be a compatible
            type of the weight argument, eg. if weight would return a float this
            argument should also be a float.
            If None, then the default for SciPy is used.

        Returns
        -------
        A : SciPy sparse array
          The incidence matrix of G.

        Notes
        -----
        For MultiGraph/MultiDiGraph, the edges in edgelist should be
        (u,v,key) 3-tuples.

        "Networks are the best discrete model for so many problems in
        applied mathematics" [1]_.

        References
        ----------
        .. [1] Gil Strang, Network applications: A = incidence matrix,
           http://videolectures.net/mit18085f07_strang_lec03/
        """
>       import scipy as sp
E       ModuleNotFoundError: No module named 'scipy'

networkx/linalg/graphmatrix.py:68: ModuleNotFoundError
_________________________________________________________________________ TestMinimumCycleBasis.test_complete_graph _________________________________________________________________________

self = <networkx.algorithms.tests.test_cycles.TestMinimumCycleBasis object at 0x7f09dbe80a00>

    def test_complete_graph(self):
        cg = nx.complete_graph(5)
        mcb = nx.minimum_cycle_basis(cg)
        assert all(len(cycle) == 3 for cycle in mcb)
>       check_independent(mcb)

networkx/algorithms/tests/test_cycles.py:889:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
networkx/algorithms/tests/test_cycles.py:22: in check_independent
    inc = nx.incidence_matrix(H, oriented=True)
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

G = <networkx.classes.graph.Graph object at 0x7f09d948e850>, nodelist = None, edgelist = None, oriented = True, weight = None

    @nx._dispatch(edge_attrs="weight")
    def incidence_matrix(
        G, nodelist=None, edgelist=None, oriented=False, weight=None, *, dtype=None
    ):
        """Returns incidence matrix of G.

        The incidence matrix assigns each row to a node and each column to an edge.
        For a standard incidence matrix a 1 appears wherever a row's node is
        incident on the column's edge.  For an oriented incidence matrix each
        edge is assigned an orientation (arbitrarily for undirected and aligning to
        direction for directed).  A -1 appears for the source (tail) of an edge and
        1 for the destination (head) of the edge.  The elements are zero otherwise.

        Parameters
        ----------
        G : graph
           A NetworkX graph

        nodelist : list, optional   (default= all nodes in G)
           The rows are ordered according to the nodes in nodelist.
           If nodelist is None, then the ordering is produced by G.nodes().

        edgelist : list, optional (default= all edges in G)
           The columns are ordered according to the edges in edgelist.
           If edgelist is None, then the ordering is produced by G.edges().

        oriented: bool, optional (default=False)
           If True, matrix elements are +1 or -1 for the head or tail node
           respectively of each edge.  If False, +1 occurs at both nodes.

        weight : string or None, optional (default=None)
           The edge data key used to provide each value in the matrix.
           If None, then each edge has weight 1.  Edge weights, if used,
           should be positive so that the orientation can provide the sign.

        dtype : a NumPy dtype or None (default=None)
            The dtype of the output sparse array. This type should be a compatible
            type of the weight argument, eg. if weight would return a float this
            argument should also be a float.
            If None, then the default for SciPy is used.

        Returns
        -------
        A : SciPy sparse array
          The incidence matrix of G.

        Notes
        -----
        For MultiGraph/MultiDiGraph, the edges in edgelist should be
        (u,v,key) 3-tuples.

        "Networks are the best discrete model for so many problems in
        applied mathematics" [1]_.

        References
        ----------
        .. [1] Gil Strang, Network applications: A = incidence matrix,
           http://videolectures.net/mit18085f07_strang_lec03/
        """
>       import scipy as sp
E       ModuleNotFoundError: No module named 'scipy'

networkx/linalg/graphmatrix.py:68: ModuleNotFoundError
_________________________________________________________________________ TestMinimumCycleBasis.test_petersen_graph _________________________________________________________________________

self = <networkx.algorithms.tests.test_cycles.TestMinimumCycleBasis object at 0x7f09dbe80190>

    def test_petersen_graph(self):
        G = nx.petersen_graph()
        mcb = list(nx.minimum_cycle_basis(G))
        expected = [
            [4, 9, 7, 5, 0],
            [1, 2, 3, 4, 0],
            [1, 6, 8, 5, 0],
            [4, 3, 8, 5, 0],
            [1, 6, 9, 4, 0],
            [1, 2, 7, 5, 0],
        ]
        assert len(mcb) == len(expected)
        assert all(c in expected for c in mcb)

        # check that order of the nodes is a path
        for c in mcb:
            assert all(G.has_edge(u, v) for u, v in nx.utils.pairwise(c, cyclic=True))
        # check independence of the basis
>       check_independent(mcb)

networkx/algorithms/tests/test_cycles.py:913:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
networkx/algorithms/tests/test_cycles.py:22: in check_independent
    inc = nx.incidence_matrix(H, oriented=True)
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

G = <networkx.classes.graph.Graph object at 0x7f09d903cb80>, nodelist = None, edgelist = None, oriented = True, weight = None

    @nx._dispatch(edge_attrs="weight")
    def incidence_matrix(
        G, nodelist=None, edgelist=None, oriented=False, weight=None, *, dtype=None
    ):
        """Returns incidence matrix of G.

        The incidence matrix assigns each row to a node and each column to an edge.
        For a standard incidence matrix a 1 appears wherever a row's node is
        incident on the column's edge.  For an oriented incidence matrix each
        edge is assigned an orientation (arbitrarily for undirected and aligning to
        direction for directed).  A -1 appears for the source (tail) of an edge and
        1 for the destination (head) of the edge.  The elements are zero otherwise.

        Parameters
        ----------
        G : graph
           A NetworkX graph

        nodelist : list, optional   (default= all nodes in G)
           The rows are ordered according to the nodes in nodelist.
           If nodelist is None, then the ordering is produced by G.nodes().

        edgelist : list, optional (default= all edges in G)
           The columns are ordered according to the edges in edgelist.
           If edgelist is None, then the ordering is produced by G.edges().

        oriented: bool, optional (default=False)
           If True, matrix elements are +1 or -1 for the head or tail node
           respectively of each edge.  If False, +1 occurs at both nodes.

        weight : string or None, optional (default=None)
           The edge data key used to provide each value in the matrix.
           If None, then each edge has weight 1.  Edge weights, if used,
           should be positive so that the orientation can provide the sign.

        dtype : a NumPy dtype or None (default=None)
            The dtype of the output sparse array. This type should be a compatible
            type of the weight argument, eg. if weight would return a float this
            argument should also be a float.
            If None, then the default for SciPy is used.

        Returns
        -------
        A : SciPy sparse array
          The incidence matrix of G.

        Notes
        -----
        For MultiGraph/MultiDiGraph, the edges in edgelist should be
        (u,v,key) 3-tuples.

        "Networks are the best discrete model for so many problems in
        applied mathematics" [1]_.

        References
        ----------
        .. [1] Gil Strang, Network applications: A = incidence matrix,
           http://videolectures.net/mit18085f07_strang_lec03/
        """
>       import scipy as sp
E       ModuleNotFoundError: No module named 'scipy'

networkx/linalg/graphmatrix.py:68: ModuleNotFoundError
____________________________________________________________ TestMinimumCycleBasis.test_gh6787_variable_weighted_complete_graph _____________________________________________________________

self = <networkx.algorithms.tests.test_cycles.TestMinimumCycleBasis object at 0x7f09dbe80e50>

    def test_gh6787_variable_weighted_complete_graph(self):
        N = 8
        cg = nx.complete_graph(N)
        cg.add_weighted_edges_from([(u, v, 9) for u, v in cg.edges])
        cg.add_weighted_edges_from([(u, v, 1) for u, v in nx.cycle_graph(N).edges])
        mcb = nx.minimum_cycle_basis(cg, weight="weight")
>       check_independent(mcb)

networkx/algorithms/tests/test_cycles.py:921:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
networkx/algorithms/tests/test_cycles.py:22: in check_independent
    inc = nx.incidence_matrix(H, oriented=True)
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

G = <networkx.classes.graph.Graph object at 0x7f09d94ec1c0>, nodelist = None, edgelist = None, oriented = True, weight = None

    @nx._dispatch(edge_attrs="weight")
    def incidence_matrix(
        G, nodelist=None, edgelist=None, oriented=False, weight=None, *, dtype=None
    ):
        """Returns incidence matrix of G.

        The incidence matrix assigns each row to a node and each column to an edge.
        For a standard incidence matrix a 1 appears wherever a row's node is
        incident on the column's edge.  For an oriented incidence matrix each
        edge is assigned an orientation (arbitrarily for undirected and aligning to
        direction for directed).  A -1 appears for the source (tail) of an edge and
        1 for the destination (head) of the edge.  The elements are zero otherwise.

        Parameters
        ----------
        G : graph
           A NetworkX graph

        nodelist : list, optional   (default= all nodes in G)
           The rows are ordered according to the nodes in nodelist.
           If nodelist is None, then the ordering is produced by G.nodes().

        edgelist : list, optional (default= all edges in G)
           The columns are ordered according to the edges in edgelist.
           If edgelist is None, then the ordering is produced by G.edges().

        oriented: bool, optional (default=False)
           If True, matrix elements are +1 or -1 for the head or tail node
           respectively of each edge.  If False, +1 occurs at both nodes.

        weight : string or None, optional (default=None)
           The edge data key used to provide each value in the matrix.
           If None, then each edge has weight 1.  Edge weights, if used,
           should be positive so that the orientation can provide the sign.

        dtype : a NumPy dtype or None (default=None)
            The dtype of the output sparse array. This type should be a compatible
            type of the weight argument, eg. if weight would return a float this
            argument should also be a float.
            If None, then the default for SciPy is used.

        Returns
        -------
        A : SciPy sparse array
          The incidence matrix of G.

        Notes
        -----
        For MultiGraph/MultiDiGraph, the edges in edgelist should be
        (u,v,key) 3-tuples.

        "Networks are the best discrete model for so many problems in
        applied mathematics" [1]_.

        References
        ----------
        .. [1] Gil Strang, Network applications: A = incidence matrix,
           http://videolectures.net/mit18085f07_strang_lec03/
        """
>       import scipy as sp
E       ModuleNotFoundError: No module named 'scipy'

networkx/linalg/graphmatrix.py:68: ModuleNotFoundError
______________________________________________________________________ TestResistanceDistance.test_resistance_distance ______________________________________________________________________

self = <networkx.algorithms.tests.test_distance_measures.TestResistanceDistance object at 0x7f09dbc71b80>

    def test_resistance_distance(self):
>       rd = nx.resistance_distance(self.G, 1, 3, "weight", True)

networkx/algorithms/tests/test_distance_measures.py:360:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
<class 'networkx.utils.decorators.argmap'> compilation 909:4: in argmap_resistance_distance_906
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
networkx/algorithms/distance_measures.py:744: in resistance_distance
    L = nx.laplacian_matrix(G, weight=weight).todense()
networkx/utils/decorators.py:770: in func
    return argmap._lazy_compile(__wrapper)(*args, **kwargs)
<class 'networkx.utils.decorators.argmap'> compilation 913:4: in argmap_laplacian_matrix_910
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

G = <networkx.classes.graph.Graph object at 0x7f09d948f970>, nodelist = None, weight = 'weight'

    @not_implemented_for("directed")
    @nx._dispatch(edge_attrs="weight")
    def laplacian_matrix(G, nodelist=None, weight="weight"):
        """Returns the Laplacian matrix of G.

        The graph Laplacian is the matrix L = D - A, where
        A is the adjacency matrix and D is the diagonal matrix of node degrees.

        Parameters
        ----------
        G : graph
           A NetworkX graph

        nodelist : list, optional
           The rows and columns are ordered according to the nodes in nodelist.
           If nodelist is None, then the ordering is produced by G.nodes().

        weight : string or None, optional (default='weight')
           The edge data key used to compute each value in the matrix.
           If None, then each edge has weight 1.

        Returns
        -------
        L : SciPy sparse array
          The Laplacian matrix of G.

        Notes
        -----
        For MultiGraph, the edges weights are summed.

        See Also
        --------
        :func:`~networkx.convert_matrix.to_numpy_array`
        normalized_laplacian_matrix
        :func:`~networkx.linalg.spectrum.laplacian_spectrum`

        Examples
        --------
        For graphs with multiple connected components, L is permutation-similar
        to a block diagonal matrix where each block is the respective Laplacian
        matrix for each component.

        >>> G = nx.Graph([(1, 2), (2, 3), (4, 5)])
        >>> print(nx.laplacian_matrix(G).toarray())
        [[ 1 -1  0  0  0]
         [-1  2 -1  0  0]
         [ 0 -1  1  0  0]
         [ 0  0  0  1 -1]
         [ 0  0  0 -1  1]]

        """
>       import scipy as sp
E       ModuleNotFoundError: No module named 'scipy'

networkx/linalg/laplacianmatrix.py:66: ModuleNotFoundError
___________________________________________________________________ TestResistanceDistance.test_resistance_distance_noinv ___________________________________________________________________

self = <networkx.algorithms.tests.test_distance_measures.TestResistanceDistance object at 0x7f09dbc71670>

    def test_resistance_distance_noinv(self):
>       rd = nx.resistance_distance(self.G, 1, 3, "weight", False)

networkx/algorithms/tests/test_distance_measures.py:365:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
<class 'networkx.utils.decorators.argmap'> compilation 909:4: in argmap_resistance_distance_906
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
networkx/algorithms/distance_measures.py:744: in resistance_distance
    L = nx.laplacian_matrix(G, weight=weight).todense()
<class 'networkx.utils.decorators.argmap'> compilation 913:4: in argmap_laplacian_matrix_910
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

G = <networkx.classes.graph.Graph object at 0x7f09d94289d0>, nodelist = None, weight = 'weight'

    @not_implemented_for("directed")
    @nx._dispatch(edge_attrs="weight")
    def laplacian_matrix(G, nodelist=None, weight="weight"):
        """Returns the Laplacian matrix of G.

        The graph Laplacian is the matrix L = D - A, where
        A is the adjacency matrix and D is the diagonal matrix of node degrees.

        Parameters
        ----------
        G : graph
           A NetworkX graph

        nodelist : list, optional
           The rows and columns are ordered according to the nodes in nodelist.
           If nodelist is None, then the ordering is produced by G.nodes().

        weight : string or None, optional (default='weight')
           The edge data key used to compute each value in the matrix.
           If None, then each edge has weight 1.

        Returns
        -------
        L : SciPy sparse array
          The Laplacian matrix of G.

        Notes
        -----
        For MultiGraph, the edges weights are summed.

        See Also
        --------
        :func:`~networkx.convert_matrix.to_numpy_array`
        normalized_laplacian_matrix
        :func:`~networkx.linalg.spectrum.laplacian_spectrum`

        Examples
        --------
        For graphs with multiple connected components, L is permutation-similar
        to a block diagonal matrix where each block is the respective Laplacian
        matrix for each component.

        >>> G = nx.Graph([(1, 2), (2, 3), (4, 5)])
        >>> print(nx.laplacian_matrix(G).toarray())
        [[ 1 -1  0  0  0]
         [-1  2 -1  0  0]
         [ 0 -1  1  0  0]
         [ 0  0  0  1 -1]
         [ 0  0  0 -1  1]]

        """
>       import scipy as sp
E       ModuleNotFoundError: No module named 'scipy'

networkx/linalg/laplacianmatrix.py:66: ModuleNotFoundError
_________________________________________________________________ TestResistanceDistance.test_resistance_distance_no_weight _________________________________________________________________

self = <networkx.algorithms.tests.test_distance_measures.TestResistanceDistance object at 0x7f09dbc71160>

    def test_resistance_distance_no_weight(self):
>       rd = nx.resistance_distance(self.G, 1, 3)

networkx/algorithms/tests/test_distance_measures.py:370:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
<class 'networkx.utils.decorators.argmap'> compilation 909:4: in argmap_resistance_distance_906
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
networkx/algorithms/distance_measures.py:744: in resistance_distance
    L = nx.laplacian_matrix(G, weight=weight).todense()
<class 'networkx.utils.decorators.argmap'> compilation 913:4: in argmap_laplacian_matrix_910
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

G = <networkx.classes.graph.Graph object at 0x7f09daebe910>, nodelist = None, weight = None

    @not_implemented_for("directed")
    @nx._dispatch(edge_attrs="weight")
    def laplacian_matrix(G, nodelist=None, weight="weight"):
        """Returns the Laplacian matrix of G.

        The graph Laplacian is the matrix L = D - A, where
        A is the adjacency matrix and D is the diagonal matrix of node degrees.

        Parameters
        ----------
        G : graph
           A NetworkX graph

        nodelist : list, optional
           The rows and columns are ordered according to the nodes in nodelist.
           If nodelist is None, then the ordering is produced by G.nodes().

        weight : string or None, optional (default='weight')
           The edge data key used to compute each value in the matrix.
           If None, then each edge has weight 1.

        Returns
        -------
        L : SciPy sparse array
          The Laplacian matrix of G.

        Notes
        -----
        For MultiGraph, the edges weights are summed.

        See Also
        --------
        :func:`~networkx.convert_matrix.to_numpy_array`
        normalized_laplacian_matrix
        :func:`~networkx.linalg.spectrum.laplacian_spectrum`

        Examples
        --------
        For graphs with multiple connected components, L is permutation-similar
        to a block diagonal matrix where each block is the respective Laplacian
        matrix for each component.

        >>> G = nx.Graph([(1, 2), (2, 3), (4, 5)])
        >>> print(nx.laplacian_matrix(G).toarray())
        [[ 1 -1  0  0  0]
         [-1  2 -1  0  0]
         [ 0 -1  1  0  0]
         [ 0  0  0  1 -1]
         [ 0  0  0 -1  1]]

        """
>       import scipy as sp
E       ModuleNotFoundError: No module named 'scipy'

networkx/linalg/laplacianmatrix.py:66: ModuleNotFoundError
________________________________________________________________ TestResistanceDistance.test_resistance_distance_neg_weight _________________________________________________________________

self = <networkx.algorithms.tests.test_distance_measures.TestResistanceDistance object at 0x7f09dbc71580>

    def test_resistance_distance_neg_weight(self):
        self.G[2][3]["weight"] = -4
>       rd = nx.resistance_distance(self.G, 1, 3, "weight", True)

networkx/algorithms/tests/test_distance_measures.py:375:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
<class 'networkx.utils.decorators.argmap'> compilation 909:4: in argmap_resistance_distance_906
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
networkx/algorithms/distance_measures.py:744: in resistance_distance
    L = nx.laplacian_matrix(G, weight=weight).todense()
<class 'networkx.utils.decorators.argmap'> compilation 913:4: in argmap_laplacian_matrix_910
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

G = <networkx.classes.graph.Graph object at 0x7f09d9bfe280>, nodelist = None, weight = 'weight'

    @not_implemented_for("directed")
    @nx._dispatch(edge_attrs="weight")
    def laplacian_matrix(G, nodelist=None, weight="weight"):
        """Returns the Laplacian matrix of G.

        The graph Laplacian is the matrix L = D - A, where
        A is the adjacency matrix and D is the diagonal matrix of node degrees.

        Parameters
        ----------
        G : graph
           A NetworkX graph

        nodelist : list, optional
           The rows and columns are ordered according to the nodes in nodelist.
           If nodelist is None, then the ordering is produced by G.nodes().

        weight : string or None, optional (default='weight')
           The edge data key used to compute each value in the matrix.
           If None, then each edge has weight 1.

        Returns
        -------
        L : SciPy sparse array
          The Laplacian matrix of G.

        Notes
        -----
        For MultiGraph, the edges weights are summed.

        See Also
        --------
        :func:`~networkx.convert_matrix.to_numpy_array`
        normalized_laplacian_matrix
        :func:`~networkx.linalg.spectrum.laplacian_spectrum`

        Examples
        --------
        For graphs with multiple connected components, L is permutation-similar
        to a block diagonal matrix where each block is the respective Laplacian
        matrix for each component.

        >>> G = nx.Graph([(1, 2), (2, 3), (4, 5)])
        >>> print(nx.laplacian_matrix(G).toarray())
        [[ 1 -1  0  0  0]
         [-1  2 -1  0  0]
         [ 0 -1  1  0  0]
         [ 0  0  0  1 -1]
         [ 0  0  0 -1  1]]

        """
>       import scipy as sp
E       ModuleNotFoundError: No module named 'scipy'

networkx/linalg/laplacianmatrix.py:66: ModuleNotFoundError
__________________________________________________________________________ TestResistanceDistance.test_multigraph ___________________________________________________________________________

self = <networkx.algorithms.tests.test_distance_measures.TestResistanceDistance object at 0x7f09dbc71df0>

    def test_multigraph(self):
        G = nx.MultiGraph()
        G.add_edge(1, 2, weight=2)
        G.add_edge(2, 3, weight=4)
        G.add_edge(3, 4, weight=1)
        G.add_edge(1, 4, weight=3)
>       rd = nx.resistance_distance(G, 1, 3, "weight", True)

networkx/algorithms/tests/test_distance_measures.py:385:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
<class 'networkx.utils.decorators.argmap'> compilation 909:4: in argmap_resistance_distance_906
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
networkx/algorithms/distance_measures.py:744: in resistance_distance
    L = nx.laplacian_matrix(G, weight=weight).todense()
<class 'networkx.utils.decorators.argmap'> compilation 913:4: in argmap_laplacian_matrix_910
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

G = <networkx.classes.multigraph.MultiGraph object at 0x7f09daebef70>, nodelist = None, weight = 'weight'

    @not_implemented_for("directed")
    @nx._dispatch(edge_attrs="weight")
    def laplacian_matrix(G, nodelist=None, weight="weight"):
        """Returns the Laplacian matrix of G.

        The graph Laplacian is the matrix L = D - A, where
        A is the adjacency matrix and D is the diagonal matrix of node degrees.

        Parameters
        ----------
        G : graph
           A NetworkX graph

        nodelist : list, optional
           The rows and columns are ordered according to the nodes in nodelist.
           If nodelist is None, then the ordering is produced by G.nodes().

        weight : string or None, optional (default='weight')
           The edge data key used to compute each value in the matrix.
           If None, then each edge has weight 1.

        Returns
        -------
        L : SciPy sparse array
          The Laplacian matrix of G.

        Notes
        -----
        For MultiGraph, the edges weights are summed.

        See Also
        --------
        :func:`~networkx.convert_matrix.to_numpy_array`
        normalized_laplacian_matrix
        :func:`~networkx.linalg.spectrum.laplacian_spectrum`

        Examples
        --------
        For graphs with multiple connected components, L is permutation-similar
        to a block diagonal matrix where each block is the respective Laplacian
        matrix for each component.

        >>> G = nx.Graph([(1, 2), (2, 3), (4, 5)])
        >>> print(nx.laplacian_matrix(G).toarray())
        [[ 1 -1  0  0  0]
         [-1  2 -1  0  0]
         [ 0 -1  1  0  0]
         [ 0  0  0  1 -1]
         [ 0  0  0 -1  1]]

        """
>       import scipy as sp
E       ModuleNotFoundError: No module named 'scipy'

networkx/linalg/laplacianmatrix.py:66: ModuleNotFoundError
_________________________________________________________________ TestResistanceDistance.test_resistance_distance_same_node _________________________________________________________________

self = <networkx.algorithms.tests.test_distance_measures.TestResistanceDistance object at 0x7f09dba6cb20>

    def test_resistance_distance_same_node(self):
>       assert nx.resistance_distance(self.G, 1, 1) == 0

networkx/algorithms/tests/test_distance_measures.py:394:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
<class 'networkx.utils.decorators.argmap'> compilation 909:4: in argmap_resistance_distance_906
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
networkx/algorithms/distance_measures.py:744: in resistance_distance
    L = nx.laplacian_matrix(G, weight=weight).todense()
<class 'networkx.utils.decorators.argmap'> compilation 913:4: in argmap_laplacian_matrix_910
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

G = <networkx.classes.graph.Graph object at 0x7f09d9a586a0>, nodelist = None, weight = None

    @not_implemented_for("directed")
    @nx._dispatch(edge_attrs="weight")
    def laplacian_matrix(G, nodelist=None, weight="weight"):
        """Returns the Laplacian matrix of G.

        The graph Laplacian is the matrix L = D - A, where
        A is the adjacency matrix and D is the diagonal matrix of node degrees.

        Parameters
        ----------
        G : graph
           A NetworkX graph

        nodelist : list, optional
           The rows and columns are ordered according to the nodes in nodelist.
           If nodelist is None, then the ordering is produced by G.nodes().

        weight : string or None, optional (default='weight')
           The edge data key used to compute each value in the matrix.
           If None, then each edge has weight 1.

        Returns
        -------
        L : SciPy sparse array
          The Laplacian matrix of G.

        Notes
        -----
        For MultiGraph, the edges weights are summed.

        See Also
        --------
        :func:`~networkx.convert_matrix.to_numpy_array`
        normalized_laplacian_matrix
        :func:`~networkx.linalg.spectrum.laplacian_spectrum`

        Examples
        --------
        For graphs with multiple connected components, L is permutation-similar
        to a block diagonal matrix where each block is the respective Laplacian
        matrix for each component.

        >>> G = nx.Graph([(1, 2), (2, 3), (4, 5)])
        >>> print(nx.laplacian_matrix(G).toarray())
        [[ 1 -1  0  0  0]
         [-1  2 -1  0  0]
         [ 0 -1  1  0  0]
         [ 0  0  0  1 -1]
         [ 0  0  0 -1  1]]

        """
>       import scipy as sp
E       ModuleNotFoundError: No module named 'scipy'

networkx/linalg/laplacianmatrix.py:66: ModuleNotFoundError
________________________________________________________________ TestResistanceDistance.test_resistance_distance_only_nodeA _________________________________________________________________

self = <networkx.algorithms.tests.test_distance_measures.TestResistanceDistance object at 0x7f09dba6cc10>

    def test_resistance_distance_only_nodeA(self):
>       rd = nx.resistance_distance(self.G, nodeA=1)

networkx/algorithms/tests/test_distance_measures.py:397:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
<class 'networkx.utils.decorators.argmap'> compilation 909:4: in argmap_resistance_distance_906
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
networkx/algorithms/distance_measures.py:744: in resistance_distance
    L = nx.laplacian_matrix(G, weight=weight).todense()
<class 'networkx.utils.decorators.argmap'> compilation 913:4: in argmap_laplacian_matrix_910
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

G = <networkx.classes.graph.Graph object at 0x7f09d8c7d5b0>, nodelist = None, weight = None

    @not_implemented_for("directed")
    @nx._dispatch(edge_attrs="weight")
    def laplacian_matrix(G, nodelist=None, weight="weight"):
        """Returns the Laplacian matrix of G.

        The graph Laplacian is the matrix L = D - A, where
        A is the adjacency matrix and D is the diagonal matrix of node degrees.

        Parameters
        ----------
        G : graph
           A NetworkX graph

        nodelist : list, optional
           The rows and columns are ordered according to the nodes in nodelist.
           If nodelist is None, then the ordering is produced by G.nodes().

        weight : string or None, optional (default='weight')
           The edge data key used to compute each value in the matrix.
           If None, then each edge has weight 1.

        Returns
        -------
        L : SciPy sparse array
          The Laplacian matrix of G.

        Notes
        -----
        For MultiGraph, the edges weights are summed.

        See Also
        --------
        :func:`~networkx.convert_matrix.to_numpy_array`
        normalized_laplacian_matrix
        :func:`~networkx.linalg.spectrum.laplacian_spectrum`

        Examples
        --------
        For graphs with multiple connected components, L is permutation-similar
        to a block diagonal matrix where each block is the respective Laplacian
        matrix for each component.

        >>> G = nx.Graph([(1, 2), (2, 3), (4, 5)])
        >>> print(nx.laplacian_matrix(G).toarray())
        [[ 1 -1  0  0  0]
         [-1  2 -1  0  0]
         [ 0 -1  1  0  0]
         [ 0  0  0  1 -1]
         [ 0  0  0 -1  1]]

        """
>       import scipy as sp
E       ModuleNotFoundError: No module named 'scipy'

networkx/linalg/laplacianmatrix.py:66: ModuleNotFoundError
________________________________________________________________ TestResistanceDistance.test_resistance_distance_only_nodeB _________________________________________________________________

self = <networkx.algorithms.tests.test_distance_measures.TestResistanceDistance object at 0x7f09dbc71070>

    def test_resistance_distance_only_nodeB(self):
>       rd = nx.resistance_distance(self.G, nodeB=1)

networkx/algorithms/tests/test_distance_measures.py:409:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
<class 'networkx.utils.decorators.argmap'> compilation 909:4: in argmap_resistance_distance_906
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
networkx/algorithms/distance_measures.py:744: in resistance_distance
    L = nx.laplacian_matrix(G, weight=weight).todense()
<class 'networkx.utils.decorators.argmap'> compilation 913:4: in argmap_laplacian_matrix_910
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

G = <networkx.classes.graph.Graph object at 0x7f09d9423820>, nodelist = None, weight = None

    @not_implemented_for("directed")
    @nx._dispatch(edge_attrs="weight")
    def laplacian_matrix(G, nodelist=None, weight="weight"):
        """Returns the Laplacian matrix of G.

        The graph Laplacian is the matrix L = D - A, where
        A is the adjacency matrix and D is the diagonal matrix of node degrees.

        Parameters
        ----------
        G : graph
           A NetworkX graph

        nodelist : list, optional
           The rows and columns are ordered according to the nodes in nodelist.
           If nodelist is None, then the ordering is produced by G.nodes().

        weight : string or None, optional (default='weight')
           The edge data key used to compute each value in the matrix.
           If None, then each edge has weight 1.

        Returns
        -------
        L : SciPy sparse array
          The Laplacian matrix of G.

        Notes
        -----
        For MultiGraph, the edges weights are summed.

        See Also
        --------
        :func:`~networkx.convert_matrix.to_numpy_array`
        normalized_laplacian_matrix
        :func:`~networkx.linalg.spectrum.laplacian_spectrum`

        Examples
        --------
        For graphs with multiple connected components, L is permutation-similar
        to a block diagonal matrix where each block is the respective Laplacian
        matrix for each component.

        >>> G = nx.Graph([(1, 2), (2, 3), (4, 5)])
        >>> print(nx.laplacian_matrix(G).toarray())
        [[ 1 -1  0  0  0]
         [-1  2 -1  0  0]
         [ 0 -1  1  0  0]
         [ 0  0  0  1 -1]
         [ 0  0  0 -1  1]]

        """
>       import scipy as sp
E       ModuleNotFoundError: No module named 'scipy'

networkx/linalg/laplacianmatrix.py:66: ModuleNotFoundError
____________________________________________________________________ TestResistanceDistance.test_resistance_distance_all ____________________________________________________________________

self = <networkx.algorithms.tests.test_distance_measures.TestResistanceDistance object at 0x7f09dc290040>

    def test_resistance_distance_all(self):
>       rd = nx.resistance_distance(self.G)

networkx/algorithms/tests/test_distance_measures.py:421:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
<class 'networkx.utils.decorators.argmap'> compilation 909:4: in argmap_resistance_distance_906
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
networkx/algorithms/distance_measures.py:744: in resistance_distance
    L = nx.laplacian_matrix(G, weight=weight).todense()
<class 'networkx.utils.decorators.argmap'> compilation 913:4: in argmap_laplacian_matrix_910
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

G = <networkx.classes.graph.Graph object at 0x7f09d8d719d0>, nodelist = None, weight = None

    @not_implemented_for("directed")
    @nx._dispatch(edge_attrs="weight")
    def laplacian_matrix(G, nodelist=None, weight="weight"):
        """Returns the Laplacian matrix of G.

        The graph Laplacian is the matrix L = D - A, where
        A is the adjacency matrix and D is the diagonal matrix of node degrees.

        Parameters
        ----------
        G : graph
           A NetworkX graph

        nodelist : list, optional
           The rows and columns are ordered according to the nodes in nodelist.
           If nodelist is None, then the ordering is produced by G.nodes().

        weight : string or None, optional (default='weight')
           The edge data key used to compute each value in the matrix.
           If None, then each edge has weight 1.

        Returns
        -------
        L : SciPy sparse array
          The Laplacian matrix of G.

        Notes
        -----
        For MultiGraph, the edges weights are summed.

        See Also
        --------
        :func:`~networkx.convert_matrix.to_numpy_array`
        normalized_laplacian_matrix
        :func:`~networkx.linalg.spectrum.laplacian_spectrum`

        Examples
        --------
        For graphs with multiple connected components, L is permutation-similar
        to a block diagonal matrix where each block is the respective Laplacian
        matrix for each component.

        >>> G = nx.Graph([(1, 2), (2, 3), (4, 5)])
        >>> print(nx.laplacian_matrix(G).toarray())
        [[ 1 -1  0  0  0]
         [-1  2 -1  0  0]
         [ 0 -1  1  0  0]
         [ 0  0  0  1 -1]
         [ 0  0  0 -1  1]]

        """
>       import scipy as sp
E       ModuleNotFoundError: No module named 'scipy'

networkx/linalg/laplacianmatrix.py:66: ModuleNotFoundError
___________________________________________________________________ TestKemenyConstant.test_kemeny_constant_not_connected ___________________________________________________________________

self = <networkx.algorithms.tests.test_distance_measures.TestKemenyConstant object at 0x7f09dbbd8550>

    def test_kemeny_constant_not_connected(self):
        self.G.add_node(5)
        with pytest.raises(nx.NetworkXError):
>           nx.kemeny_constant(self.G)

networkx/algorithms/tests/test_distance_measures.py:540:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
<class 'networkx.utils.decorators.argmap'> compilation 921:4: in argmap_kemeny_constant_918
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

G = <networkx.classes.graph.Graph object at 0x7f09daba5190>

    @nx.utils.not_implemented_for("directed")
    @nx._dispatch(edge_attrs="weight")
    def kemeny_constant(G, *, weight=None):
        """Returns the Kemeny constant of the given graph.

        The *Kemeny constant* (or Kemeny's constant) of a graph `G`
        can be computed by regarding the graph as a Markov chain.
        The Kemeny constant is then the expected number of time steps
        to transition from a starting state i to a random destination state
        sampled from the Markov chain's stationary distribution.
        The Kemeny constant is independent of the chosen initial state [1]_.

        The Kemeny constant measures the time needed for spreading
        across a graph. Low values indicate a closely connected graph
        whereas high values indicate a spread-out graph.

        If weight is not provided, then a weight of 1 is used for all edges.

        Since `G` represents a Markov chain, the weights must be positive.

        Parameters
        ----------
        G : NetworkX graph

        weight : string or None, optional (default=None)
           The edge data key used to compute the Kemeny constant.
           If None, then each edge has weight 1.

        Returns
        -------
        K : float
            The Kemeny constant of the graph `G`.

        Raises
        ------
        NetworkXNotImplemented
            If the graph `G` is directed.

        NetworkXError
            If the graph `G` is not connected, or contains no nodes,
            or has edges with negative weights.

        Examples
        --------
        >>> G = nx.complete_graph(5)
        >>> round(nx.kemeny_constant(G), 10)
        3.2

        Notes
        -----
        The implementation is based on equation (3.3) in [2]_.
        Self-loops are allowed and indicate a Markov chain where
        the state can remain the same. Multi-edges are contracted
        in one edge with weight equal to the sum of the weights.

        References
        ----------
        .. [1] Wikipedia
           "Kemeny's constant."
           https://en.wikipedia.org/wiki/Kemeny%27s_constant
        .. [2] Lovász L.
            Random walks on graphs: A survey.
            Paul Erdös is Eighty, vol. 2, Bolyai Society,
            Mathematical Studies, Keszthely, Hungary (1993), pp. 1-46
        """
        import numpy as np
>       import scipy as sp
E       ModuleNotFoundError: No module named 'scipy'

networkx/algorithms/distance_measures.py:846: ModuleNotFoundError
_____________________________________________________________________ TestKemenyConstant.test_kemeny_constant_no_nodes ______________________________________________________________________

self = <networkx.algorithms.tests.test_distance_measures.TestKemenyConstant object at 0x7f09dbbd8b20>

    def test_kemeny_constant_no_nodes(self):
        G = nx.Graph()
        with pytest.raises(nx.NetworkXError):
>           nx.kemeny_constant(G)

networkx/algorithms/tests/test_distance_measures.py:545:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
<class 'networkx.utils.decorators.argmap'> compilation 921:4: in argmap_kemeny_constant_918
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

G = <networkx.classes.graph.Graph object at 0x7f09d9ca7250>

    @nx.utils.not_implemented_for("directed")
    @nx._dispatch(edge_attrs="weight")
    def kemeny_constant(G, *, weight=None):
        """Returns the Kemeny constant of the given graph.

        The *Kemeny constant* (or Kemeny's constant) of a graph `G`
        can be computed by regarding the graph as a Markov chain.
        The Kemeny constant is then the expected number of time steps
        to transition from a starting state i to a random destination state
        sampled from the Markov chain's stationary distribution.
        The Kemeny constant is independent of the chosen initial state [1]_.

        The Kemeny constant measures the time needed for spreading
        across a graph. Low values indicate a closely connected graph
        whereas high values indicate a spread-out graph.

        If weight is not provided, then a weight of 1 is used for all edges.

        Since `G` represents a Markov chain, the weights must be positive.

        Parameters
        ----------
        G : NetworkX graph

        weight : string or None, optional (default=None)
           The edge data key used to compute the Kemeny constant.
           If None, then each edge has weight 1.

        Returns
        -------
        K : float
            The Kemeny constant of the graph `G`.

        Raises
        ------
        NetworkXNotImplemented
            If the graph `G` is directed.

        NetworkXError
            If the graph `G` is not connected, or contains no nodes,
            or has edges with negative weights.

        Examples
        --------
        >>> G = nx.complete_graph(5)
        >>> round(nx.kemeny_constant(G), 10)
        3.2

        Notes
        -----
        The implementation is based on equation (3.3) in [2]_.
        Self-loops are allowed and indicate a Markov chain where
        the state can remain the same. Multi-edges are contracted
        in one edge with weight equal to the sum of the weights.

        References
        ----------
        .. [1] Wikipedia
           "Kemeny's constant."
           https://en.wikipedia.org/wiki/Kemeny%27s_constant
        .. [2] Lovász L.
            Random walks on graphs: A survey.
            Paul Erdös is Eighty, vol. 2, Bolyai Society,
            Mathematical Studies, Keszthely, Hungary (1993), pp. 1-46
        """
        import numpy as np
>       import scipy as sp
E       ModuleNotFoundError: No module named 'scipy'

networkx/algorithms/distance_measures.py:846: ModuleNotFoundError
__________________________________________________________________ TestKemenyConstant.test_kemeny_constant_negative_weight __________________________________________________________________

self = <networkx.algorithms.tests.test_distance_measures.TestKemenyConstant object at 0x7f09dbbd8d90>

    def test_kemeny_constant_negative_weight(self):
        G = nx.Graph()
        w12 = 2
        w13 = 3
        w23 = -10
        G.add_edge(1, 2, weight=w12)
        G.add_edge(1, 3, weight=w13)
        G.add_edge(2, 3, weight=w23)
        with pytest.raises(nx.NetworkXError):
>           nx.kemeny_constant(G, weight="weight")

networkx/algorithms/tests/test_distance_measures.py:556:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
<class 'networkx.utils.decorators.argmap'> compilation 921:4: in argmap_kemeny_constant_918
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

G = <networkx.classes.graph.Graph object at 0x7f09d94857c0>

    @nx.utils.not_implemented_for("directed")
    @nx._dispatch(edge_attrs="weight")
    def kemeny_constant(G, *, weight=None):
        """Returns the Kemeny constant of the given graph.

        The *Kemeny constant* (or Kemeny's constant) of a graph `G`
        can be computed by regarding the graph as a Markov chain.
        The Kemeny constant is then the expected number of time steps
        to transition from a starting state i to a random destination state
        sampled from the Markov chain's stationary distribution.
        The Kemeny constant is independent of the chosen initial state [1]_.

        The Kemeny constant measures the time needed for spreading
        across a graph. Low values indicate a closely connected graph
        whereas high values indicate a spread-out graph.

        If weight is not provided, then a weight of 1 is used for all edges.

        Since `G` represents a Markov chain, the weights must be positive.

        Parameters
        ----------
        G : NetworkX graph

        weight : string or None, optional (default=None)
           The edge data key used to compute the Kemeny constant.
           If None, then each edge has weight 1.

        Returns
        -------
        K : float
            The Kemeny constant of the graph `G`.

        Raises
        ------
        NetworkXNotImplemented
            If the graph `G` is directed.

        NetworkXError
            If the graph `G` is not connected, or contains no nodes,
            or has edges with negative weights.

        Examples
        --------
        >>> G = nx.complete_graph(5)
        >>> round(nx.kemeny_constant(G), 10)
        3.2

        Notes
        -----
        The implementation is based on equation (3.3) in [2]_.
        Self-loops are allowed and indicate a Markov chain where
        the state can remain the same. Multi-edges are contracted
        in one edge with weight equal to the sum of the weights.

        References
        ----------
        .. [1] Wikipedia
           "Kemeny's constant."
           https://en.wikipedia.org/wiki/Kemeny%27s_constant
        .. [2] Lovász L.
            Random walks on graphs: A survey.
            Paul Erdös is Eighty, vol. 2, Bolyai Society,
            Mathematical Studies, Keszthely, Hungary (1993), pp. 1-46
        """
        import numpy as np
>       import scipy as sp
E       ModuleNotFoundError: No module named 'scipy'

networkx/algorithms/distance_measures.py:846: ModuleNotFoundError
__________________________________________________________________________ TestKemenyConstant.test_kemeny_constant __________________________________________________________________________

self = <networkx.algorithms.tests.test_distance_measures.TestKemenyConstant object at 0x7f09dbbd8ac0>

    def test_kemeny_constant(self):
>       K = nx.kemeny_constant(self.G, weight="weight")

networkx/algorithms/tests/test_distance_measures.py:559:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
<class 'networkx.utils.decorators.argmap'> compilation 921:4: in argmap_kemeny_constant_918
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

G = <networkx.classes.graph.Graph object at 0x7f09d8caf7f0>

    @nx.utils.not_implemented_for("directed")
    @nx._dispatch(edge_attrs="weight")
    def kemeny_constant(G, *, weight=None):
        """Returns the Kemeny constant of the given graph.

        The *Kemeny constant* (or Kemeny's constant) of a graph `G`
        can be computed by regarding the graph as a Markov chain.
        The Kemeny constant is then the expected number of time steps
        to transition from a starting state i to a random destination state
        sampled from the Markov chain's stationary distribution.
        The Kemeny constant is independent of the chosen initial state [1]_.

        The Kemeny constant measures the time needed for spreading
        across a graph. Low values indicate a closely connected graph
        whereas high values indicate a spread-out graph.

        If weight is not provided, then a weight of 1 is used for all edges.

        Since `G` represents a Markov chain, the weights must be positive.

        Parameters
        ----------
        G : NetworkX graph

        weight : string or None, optional (default=None)
           The edge data key used to compute the Kemeny constant.
           If None, then each edge has weight 1.

        Returns
        -------
        K : float
            The Kemeny constant of the graph `G`.

        Raises
        ------
        NetworkXNotImplemented
            If the graph `G` is directed.

        NetworkXError
            If the graph `G` is not connected, or contains no nodes,
            or has edges with negative weights.

        Examples
        --------
        >>> G = nx.complete_graph(5)
        >>> round(nx.kemeny_constant(G), 10)
        3.2

        Notes
        -----
        The implementation is based on equation (3.3) in [2]_.
        Self-loops are allowed and indicate a Markov chain where
        the state can remain the same. Multi-edges are contracted
        in one edge with weight equal to the sum of the weights.

        References
        ----------
        .. [1] Wikipedia
           "Kemeny's constant."
           https://en.wikipedia.org/wiki/Kemeny%27s_constant
        .. [2] Lovász L.
            Random walks on graphs: A survey.
            Paul Erdös is Eighty, vol. 2, Bolyai Society,
            Mathematical Studies, Keszthely, Hungary (1993), pp. 1-46
        """
        import numpy as np
>       import scipy as sp
E       ModuleNotFoundError: No module named 'scipy'

networkx/algorithms/distance_measures.py:846: ModuleNotFoundError
_____________________________________________________________________ TestKemenyConstant.test_kemeny_constant_no_weight _____________________________________________________________________

self = <networkx.algorithms.tests.test_distance_measures.TestKemenyConstant object at 0x7f09dbbd86d0>

    def test_kemeny_constant_no_weight(self):
>       K = nx.kemeny_constant(self.G)

networkx/algorithms/tests/test_distance_measures.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
<class 'networkx.utils.decorators.argmap'> compilation 921:4: in argmap_kemeny_constant_918
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

G = <networkx.classes.graph.Graph object at 0x7f09d9bc8190>

    @nx.utils.not_implemented_for("directed")
    @nx._dispatch(edge_attrs="weight")
    def kemeny_constant(G, *, weight=None):
        """Returns the Kemeny constant of the given graph.

        The *Kemeny constant* (or Kemeny's constant) of a graph `G`
        can be computed by regarding the graph as a Markov chain.
        The Kemeny constant is then the expected number of time steps
        to transition from a starting state i to a random destination state
        sampled from the Markov chain's stationary distribution.
        The Kemeny constant is independent of the chosen initial state [1]_.

        The Kemeny constant measures the time needed for spreading
        across a graph. Low values indicate a closely connected graph
        whereas high values indicate a spread-out graph.

        If weight is not provided, then a weight of 1 is used for all edges.

        Since `G` represents a Markov chain, the weights must be positive.

        Parameters
        ----------
        G : NetworkX graph

        weight : string or None, optional (default=None)
           The edge data key used to compute the Kemeny constant.
           If None, then each edge has weight 1.

        Returns
        -------
        K : float
            The Kemeny constant of the graph `G`.

        Raises
        ------
        NetworkXNotImplemented
            If the graph `G` is directed.

        NetworkXError
            If the graph `G` is not connected, or contains no nodes,
            or has edges with negative weights.

        Examples
        --------
        >>> G = nx.complete_graph(5)
        >>> round(nx.kemeny_constant(G), 10)
        3.2

        Notes
        -----
        The implementation is based on equation (3.3) in [2]_.
        Self-loops are allowed and indicate a Markov chain where
        the state can remain the same. Multi-edges are contracted
        in one edge with weight equal to the sum of the weights.

        References
        ----------
        .. [1] Wikipedia
           "Kemeny's constant."
           https://en.wikipedia.org/wiki/Kemeny%27s_constant
        .. [2] Lovász L.
            Random walks on graphs: A survey.
            Paul Erdös is Eighty, vol. 2, Bolyai Society,
            Mathematical Studies, Keszthely, Hungary (1993), pp. 1-46
        """
        import numpy as np
>       import scipy as sp
E       ModuleNotFoundError: No module named 'scipy'

networkx/algorithms/distance_measures.py:846: ModuleNotFoundError
____________________________________________________________________ TestKemenyConstant.test_kemeny_constant_multigraph _____________________________________________________________________

self = <networkx.algorithms.tests.test_distance_measures.TestKemenyConstant object at 0x7f09dbbd83d0>

    def test_kemeny_constant_multigraph(self):
        G = nx.MultiGraph()
        w12_1 = 2
        w12_2 = 1
        w13 = 3
        w23 = 4
        G.add_edge(1, 2, weight=w12_1)
        G.add_edge(1, 2, weight=w12_2)
        G.add_edge(1, 3, weight=w13)
        G.add_edge(2, 3, weight=w23)
>       K = nx.kemeny_constant(G, weight="weight")

networkx/algorithms/tests/test_distance_measures.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
<class 'networkx.utils.decorators.argmap'> compilation 921:4: in argmap_kemeny_constant_918
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

G = <networkx.classes.multigraph.MultiGraph object at 0x7f09daf9c8b0>

    @nx.utils.not_implemented_for("directed")
    @nx._dispatch(edge_attrs="weight")
    def kemeny_constant(G, *, weight=None):
        """Returns the Kemeny constant of the given graph.

        The *Kemeny constant* (or Kemeny's constant) of a graph `G`
        can be computed by regarding the graph as a Markov chain.
        The Kemeny constant is then the expected number of time steps
        to transition from a starting state i to a random destination state
        sampled from the Markov chain's stationary distribution.
        The Kemeny constant is independent of the chosen initial state [1]_.

        The Kemeny constant measures the time needed for spreading
        across a graph. Low values indicate a closely connected graph
        whereas high values indicate a spread-out graph.

        If weight is not provided, then a weight of 1 is used for all edges.

        Since `G` represents a Markov chain, the weights must be positive.

        Parameters
        ----------
        G : NetworkX graph

        weight : string or None, optional (default=None)
           The edge data key used to compute the Kemeny constant.
           If None, then each edge has weight 1.

        Returns
        -------
        K : float
            The Kemeny constant of the graph `G`.

        Raises
        ------
        NetworkXNotImplemented
            If the graph `G` is directed.

        NetworkXError
            If the graph `G` is not connected, or contains no nodes,
            or has edges with negative weights.

        Examples
        --------
        >>> G = nx.complete_graph(5)
        >>> round(nx.kemeny_constant(G), 10)
        3.2

        Notes
        -----
        The implementation is based on equation (3.3) in [2]_.
        Self-loops are allowed and indicate a Markov chain where
        the state can remain the same. Multi-edges are contracted
        in one edge with weight equal to the sum of the weights.

        References
        ----------
        .. [1] Wikipedia
           "Kemeny's constant."
           https://en.wikipedia.org/wiki/Kemeny%27s_constant
        .. [2] Lovász L.
            Random walks on graphs: A survey.
            Paul Erdös is Eighty, vol. 2, Bolyai Society,
            Mathematical Studies, Keszthely, Hungary (1993), pp. 1-46
        """
        import numpy as np
>       import scipy as sp
E       ModuleNotFoundError: No module named 'scipy'

networkx/algorithms/distance_measures.py:846: ModuleNotFoundError
______________________________________________________________________ TestKemenyConstant.test_kemeny_constant_weight0 ______________________________________________________________________

self = <networkx.algorithms.tests.test_distance_measures.TestKemenyConstant object at 0x7f09dbe64f40>

    def test_kemeny_constant_weight0(self):
        G = nx.Graph()
        w12 = 0
        w13 = 3
        w23 = 4
        G.add_edge(1, 2, weight=w12)
        G.add_edge(1, 3, weight=w13)
        G.add_edge(2, 3, weight=w23)
>       K = nx.kemeny_constant(G, weight="weight")

networkx/algorithms/tests/test_distance_measures.py:617:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
<class 'networkx.utils.decorators.argmap'> compilation 921:4: in argmap_kemeny_constant_918
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

G = <networkx.classes.graph.Graph object at 0x7f09d948d400>

    @nx.utils.not_implemented_for("directed")
    @nx._dispatch(edge_attrs="weight")
    def kemeny_constant(G, *, weight=None):
        """Returns the Kemeny constant of the given graph.

        The *Kemeny constant* (or Kemeny's constant) of a graph `G`
        can be computed by regarding the graph as a Markov chain.
        The Kemeny constant is then the expected number of time steps
        to transition from a starting state i to a random destination state
        sampled from the Markov chain's stationary distribution.
        The Kemeny constant is independent of the chosen initial state [1]_.

        The Kemeny constant measures the time needed for spreading
        across a graph. Low values indicate a closely connected graph
        whereas high values indicate a spread-out graph.

        If weight is not provided, then a weight of 1 is used for all edges.

        Since `G` represents a Markov chain, the weights must be positive.

        Parameters
        ----------
        G : NetworkX graph

        weight : string or None, optional (default=None)
           The edge data key used to compute the Kemeny constant.
           If None, then each edge has weight 1.

        Returns
        -------
        K : float
            The Kemeny constant of the graph `G`.

        Raises
        ------
        NetworkXNotImplemented
            If the graph `G` is directed.

        NetworkXError
            If the graph `G` is not connected, or contains no nodes,
            or has edges with negative weights.

        Examples
        --------
        >>> G = nx.complete_graph(5)
        >>> round(nx.kemeny_constant(G), 10)
        3.2

        Notes
        -----
        The implementation is based on equation (3.3) in [2]_.
        Self-loops are allowed and indicate a Markov chain where
        the state can remain the same. Multi-edges are contracted
        in one edge with weight equal to the sum of the weights.

        References
        ----------
        .. [1] Wikipedia
           "Kemeny's constant."
           https://en.wikipedia.org/wiki/Kemeny%27s_constant
        .. [2] Lovász L.
            Random walks on graphs: A survey.
            Paul Erdös is Eighty, vol. 2, Bolyai Society,
            Mathematical Studies, Keszthely, Hungary (1993), pp. 1-46
        """
        import numpy as np
>       import scipy as sp
E       ModuleNotFoundError: No module named 'scipy'

networkx/algorithms/distance_measures.py:846: ModuleNotFoundError
_____________________________________________________________________ TestKemenyConstant.test_kemeny_constant_selfloop ______________________________________________________________________

self = <networkx.algorithms.tests.test_distance_measures.TestKemenyConstant object at 0x7f09dbe64730>

    def test_kemeny_constant_selfloop(self):
        G = nx.Graph()
        w11 = 1
        w12 = 2
        w13 = 3
        w23 = 4
        G.add_edge(1, 1, weight=w11)
        G.add_edge(1, 2, weight=w12)
        G.add_edge(1, 3, weight=w13)
        G.add_edge(2, 3, weight=w23)
>       K = nx.kemeny_constant(G, weight="weight")

networkx/algorithms/tests/test_distance_measures.py:643:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
<class 'networkx.utils.decorators.argmap'> compilation 921:4: in argmap_kemeny_constant_918
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

G = <networkx.classes.graph.Graph object at 0x7f09d8cac310>

    @nx.utils.not_implemented_for("directed")
    @nx._dispatch(edge_attrs="weight")
    def kemeny_constant(G, *, weight=None):
        """Returns the Kemeny constant of the given graph.

        The *Kemeny constant* (or Kemeny's constant) of a graph `G`
        can be computed by regarding the graph as a Markov chain.
        The Kemeny constant is then the expected number of time steps
        to transition from a starting state i to a random destination state
        sampled from the Markov chain's stationary distribution.
        The Kemeny constant is independent of the chosen initial state [1]_.

        The Kemeny constant measures the time needed for spreading
        across a graph. Low values indicate a closely connected graph
        whereas high values indicate a spread-out graph.

        If weight is not provided, then a weight of 1 is used for all edges.

        Since `G` represents a Markov chain, the weights must be positive.

        Parameters
        ----------
        G : NetworkX graph

        weight : string or None, optional (default=None)
           The edge data key used to compute the Kemeny constant.
           If None, then each edge has weight 1.

        Returns
        -------
        K : float
            The Kemeny constant of the graph `G`.

        Raises
        ------
        NetworkXNotImplemented
            If the graph `G` is directed.

        NetworkXError
            If the graph `G` is not connected, or contains no nodes,
            or has edges with negative weights.

        Examples
        --------
        >>> G = nx.complete_graph(5)
        >>> round(nx.kemeny_constant(G), 10)
        3.2

        Notes
        -----
        The implementation is based on equation (3.3) in [2]_.
        Self-loops are allowed and indicate a Markov chain where
        the state can remain the same. Multi-edges are contracted
        in one edge with weight equal to the sum of the weights.

        References
        ----------
        .. [1] Wikipedia
           "Kemeny's constant."
           https://en.wikipedia.org/wiki/Kemeny%27s_constant
        .. [2] Lovász L.
            Random walks on graphs: A survey.
            Paul Erdös is Eighty, vol. 2, Bolyai Society,
            Mathematical Studies, Keszthely, Hungary (1993), pp. 1-46
        """
        import numpy as np
>       import scipy as sp
E       ModuleNotFoundError: No module named 'scipy'

networkx/algorithms/distance_measures.py:846: ModuleNotFoundError
_____________________________________________________________ TestKemenyConstant.test_kemeny_constant_complete_bipartite_graph ______________________________________________________________

self = <networkx.algorithms.tests.test_distance_measures.TestKemenyConstant object at 0x7f09dba58b20>

    def test_kemeny_constant_complete_bipartite_graph(self):
        # Theorem 1 in https://www.sciencedirect.com/science/article/pii/S0166218X20302912
        n1 = 5
        n2 = 4
        G = nx.complete_bipartite_graph(n1, n2)
>       K = nx.kemeny_constant(G)

networkx/algorithms/tests/test_distance_measures.py:660:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
<class 'networkx.utils.decorators.argmap'> compilation 921:4: in argmap_kemeny_constant_918
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

G = <networkx.classes.graph.Graph object at 0x7f09d948eac0>

    @nx.utils.not_implemented_for("directed")
    @nx._dispatch(edge_attrs="weight")
    def kemeny_constant(G, *, weight=None):
        """Returns the Kemeny constant of the given graph.

        The *Kemeny constant* (or Kemeny's constant) of a graph `G`
        can be computed by regarding the graph as a Markov chain.
        The Kemeny constant is then the expected number of time steps
        to transition from a starting state i to a random destination state
        sampled from the Markov chain's stationary distribution.
        The Kemeny constant is independent of the chosen initial state [1]_.

        The Kemeny constant measures the time needed for spreading
        across a graph. Low values indicate a closely connected graph
        whereas high values indicate a spread-out graph.

        If weight is not provided, then a weight of 1 is used for all edges.

        Since `G` represents a Markov chain, the weights must be positive.

        Parameters
        ----------
        G : NetworkX graph

        weight : string or None, optional (default=None)
           The edge data key used to compute the Kemeny constant.
           If None, then each edge has weight 1.

        Returns
        -------
        K : float
            The Kemeny constant of the graph `G`.

        Raises
        ------
        NetworkXNotImplemented
            If the graph `G` is directed.

        NetworkXError
            If the graph `G` is not connected, or contains no nodes,
            or has edges with negative weights.

        Examples
        --------
        >>> G = nx.complete_graph(5)
        >>> round(nx.kemeny_constant(G), 10)
        3.2

        Notes
        -----
        The implementation is based on equation (3.3) in [2]_.
        Self-loops are allowed and indicate a Markov chain where
        the state can remain the same. Multi-edges are contracted
        in one edge with weight equal to the sum of the weights.

        References
        ----------
        .. [1] Wikipedia
           "Kemeny's constant."
           https://en.wikipedia.org/wiki/Kemeny%27s_constant
        .. [2] Lovász L.
            Random walks on graphs: A survey.
            Paul Erdös is Eighty, vol. 2, Bolyai Society,
            Mathematical Studies, Keszthely, Hungary (1993), pp. 1-46
        """
        import numpy as np
>       import scipy as sp
E       ModuleNotFoundError: No module named 'scipy'

networkx/algorithms/distance_measures.py:846: ModuleNotFoundError
____________________________________________________________________ TestKemenyConstant.test_kemeny_constant_path_graph _____________________________________________________________________

self = <networkx.algorithms.tests.test_distance_measures.TestKemenyConstant object at 0x7f09dba58f40>

    def test_kemeny_constant_path_graph(self):
        # Theorem 2 in https://www.sciencedirect.com/science/article/pii/S0166218X20302912
        n = 10
        G = nx.path_graph(n)
>       K = nx.kemeny_constant(G)

networkx/algorithms/tests/test_distance_measures.py:667:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
<class 'networkx.utils.decorators.argmap'> compilation 921:4: in argmap_kemeny_constant_918
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

G = <networkx.classes.graph.Graph object at 0x7f09d9b082e0>

    @nx.utils.not_implemented_for("directed")
    @nx._dispatch(edge_attrs="weight")
    def kemeny_constant(G, *, weight=None):
        """Returns the Kemeny constant of the given graph.

        The *Kemeny constant* (or Kemeny's constant) of a graph `G`
        can be computed by regarding the graph as a Markov chain.
        The Kemeny constant is then the expected number of time steps
        to transition from a starting state i to a random destination state
        sampled from the Markov chain's stationary distribution.
        The Kemeny constant is independent of the chosen initial state [1]_.

        The Kemeny constant measures the time needed for spreading
        across a graph. Low values indicate a closely connected graph
        whereas high values indicate a spread-out graph.

        If weight is not provided, then a weight of 1 is used for all edges.

        Since `G` represents a Markov chain, the weights must be positive.

        Parameters
        ----------
        G : NetworkX graph

        weight : string or None, optional (default=None)
           The edge data key used to compute the Kemeny constant.
           If None, then each edge has weight 1.

        Returns
        -------
        K : float
            The Kemeny constant of the graph `G`.

        Raises
        ------
        NetworkXNotImplemented
            If the graph `G` is directed.

        NetworkXError
            If the graph `G` is not connected, or contains no nodes,
            or has edges with negative weights.

        Examples
        --------
        >>> G = nx.complete_graph(5)
        >>> round(nx.kemeny_constant(G), 10)
        3.2

        Notes
        -----
        The implementation is based on equation (3.3) in [2]_.
        Self-loops are allowed and indicate a Markov chain where
        the state can remain the same. Multi-edges are contracted
        in one edge with weight equal to the sum of the weights.

        References
        ----------
        .. [1] Wikipedia
           "Kemeny's constant."
           https://en.wikipedia.org/wiki/Kemeny%27s_constant
        .. [2] Lovász L.
            Random walks on graphs: A survey.
            Paul Erdös is Eighty, vol. 2, Bolyai Society,
            Mathematical Studies, Keszthely, Hungary (1993), pp. 1-46
        """
        import numpy as np
>       import scipy as sp
E       ModuleNotFoundError: No module named 'scipy'

networkx/algorithms/distance_measures.py:846: ModuleNotFoundError
===================================================================================== warnings summary ======================================================================================
networkx/utils/backends.py:135
  /home/tkloczko/rpmbuild/BUILD/networkx-networkx-3.2.1/networkx/utils/backends.py:135: RuntimeWarning: networkx backend defined more than once: nx-loopback
    backends.update(_get_backends("networkx.backends"))

networkx/utils/backends.py:576
  /home/tkloczko/rpmbuild/BUILD/networkx-networkx-3.2.1/networkx/utils/backends.py:576: DeprecationWarning:

  random_tree is deprecated and will be removed in NX v3.4
  Use random_labeled_tree instead.
    return self.orig_func(*args, **kwargs)

networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_single_node
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_with_c
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_normalized_endpoints
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_disconnected_graph
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_group_betweenness_directed_weighted
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_greedy_algorithm
  /home/tkloczko/rpmbuild/BUILD/networkx-networkx-3.2.1/networkx/algorithms/centrality/group.py:501: FutureWarning: ChainedAssignmentError: behaviour will change in pandas 3.0!
  You are setting values through chained assignment. Currently this works in certain cases, but when using Copy-on-Write (which will become the default behaviour in pandas 3.0) this will never work to update the original DataFrame or Series, because the intermediate object on which we are setting values will behave as a copy.
  A typical example is when you are setting values in a column of a DataFrame, like:

  df["col"][row_indexer] = value

  Use `df.loc[row_indexer, "col"] = values` instead, to perform the assignment in a single step and ensure this keeps updating the original `df`.

  See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy

    DF_tree.nodes[node_p]["betweenness"][x][y] = (

networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_single_node
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_with_c
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_normalized_endpoints
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_disconnected_graph
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_group_betweenness_directed_weighted
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_greedy_algorithm
  /home/tkloczko/rpmbuild/BUILD/networkx-networkx-3.2.1/networkx/algorithms/centrality/group.py:505: FutureWarning: ChainedAssignmentError: behaviour will change in pandas 3.0!
  You are setting values through chained assignment. Currently this works in certain cases, but when using Copy-on-Write (which will become the default behaviour in pandas 3.0) this will never work to update the original DataFrame or Series, because the intermediate object on which we are setting values will behave as a copy.
  A typical example is when you are setting values in a column of a DataFrame, like:

  df["col"][row_indexer] = value

  Use `df.loc[row_indexer, "col"] = values` instead, to perform the assignment in a single step and ensure this keeps updating the original `df`.

  See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy

    DF_tree.nodes[node_p]["betweenness"][x][y] -= (

networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_single_node
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_with_c
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_normalized_endpoints
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_disconnected_graph
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_group_betweenness_directed_weighted
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_greedy_algorithm
  /home/tkloczko/rpmbuild/BUILD/networkx-networkx-3.2.1/networkx/algorithms/centrality/group.py:509: FutureWarning: ChainedAssignmentError: behaviour will change in pandas 3.0!
  You are setting values through chained assignment. Currently this works in certain cases, but when using Copy-on-Write (which will become the default behaviour in pandas 3.0) this will never work to update the original DataFrame or Series, because the intermediate object on which we are setting values will behave as a copy.
  A typical example is when you are setting values in a column of a DataFrame, like:

  df["col"][row_indexer] = value

  Use `df.loc[row_indexer, "col"] = values` instead, to perform the assignment in a single step and ensure this keeps updating the original `df`.

  See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy

    DF_tree.nodes[node_p]["betweenness"][x][y] -= (

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================================================== short test summary info ==================================================================================
SKIPPED [1] networkx/algorithms/assortativity/tests/test_correlation.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/bipartite/tests/test_matrix.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/bipartite/tests/test_spectral_bipartivity.py:3: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality.py:8: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality_subset.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_current_flow_closeness.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_eigenvector_centrality.py:6: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_laplacian_centrality.py:6: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_second_order_centrality.py:8: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_subgraph.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_trophic.py:6: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/link_analysis/tests/test_hits.py:6: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/link_analysis/tests/test_pagerank.py:9: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_communicability.py:6: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_node_classification.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_polynomials.py:7: could not import 'sympy': No module named 'sympy'
SKIPPED [1] networkx/algorithms/tests/test_walks.py:8: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/classes/tests/test_backends.py:7: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/drawing/tests/test_agraph.py:7: could not import 'pygraphviz': No module named 'pygraphviz'
SKIPPED [1] networkx/drawing/tests/test_layout.py:7: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/drawing/tests/test_pydot.py:11: could not import 'pydot': No module named 'pydot'
SKIPPED [1] networkx/generators/tests/test_spectral_graph_forge.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_bethehessian.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_graphmatrix.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_laplacian.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_modularity.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_spectrum.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/tests/test_convert_scipy.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/approximation/tests/test_traveling_salesman.py:394: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/approximation/tests/test_traveling_salesman.py:431: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/approximation/tests/test_traveling_salesman.py:487: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/approximation/tests/test_traveling_salesman.py:522: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/approximation/tests/test_traveling_salesman.py:562: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/approximation/tests/test_traveling_salesman.py:601: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/approximation/tests/test_traveling_salesman.py:660: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/approximation/tests/test_traveling_salesman.py:715: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/approximation/tests/test_traveling_salesman.py:784: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/approximation/tests/test_traveling_salesman.py:832: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/approximation/tests/test_traveling_salesman.py:905: need --runslow option to run
SKIPPED [1] networkx/algorithms/bipartite/tests/test_basic.py:97: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/bipartite/tests/test_basic.py:108: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/bipartite/tests/test_basic.py:119: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/bipartite/tests/test_matching.py:223: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/bipartite/tests/test_matching.py:233: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/bipartite/tests/test_matching.py:245: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/bipartite/tests/test_matching.py:259: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/bipartite/tests/test_matching.py:276: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/bipartite/tests/test_matching.py:293: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/bipartite/tests/test_matching.py:310: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/bipartite/tests/test_matching.py:319: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:121: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:134: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:143: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:152: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:161: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:201: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:205: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:209: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:215: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:220: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:233: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:317: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:324: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:339: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/connectivity/tests/test_kcomponents.py:94: need --runslow option to run
SKIPPED [1] networkx/algorithms/connectivity/tests/test_kcomponents.py:110: need --runslow option to run
SKIPPED [1] networkx/algorithms/connectivity/tests/test_kcomponents.py:117: need --runslow option to run
SKIPPED [1] networkx/algorithms/connectivity/tests/test_kcutsets.py:136: need --runslow option to run
SKIPPED [1] networkx/algorithms/connectivity/tests/test_kcutsets.py:210: need --runslow option to run
SKIPPED [1] networkx/algorithms/flow/tests/test_gomory_hu.py:76: need --runslow option to run
SKIPPED [1] networkx/algorithms/flow/tests/test_maxflow_large_graph.py:128: need --runslow option to run
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:44: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:60: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:86: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:101: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:116: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:153: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:190: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:197: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:238: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:252: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:281: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:310: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:339: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:363: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:372: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:383: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:394: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:405: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:417: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:432: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:445: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:457: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:471: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:489: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:501: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:513: could not import 'scipy': No module named 'scipy'
SKIPPED [2] networkx/algorithms/tests/test_similarity.py:531: could not import 'scipy': No module named 'scipy'
SKIPPED [2] networkx/algorithms/tests/test_similarity.py:609: could not import 'scipy': No module named 'scipy'
SKIPPED [2] networkx/algorithms/tests/test_similarity.py:637: could not import 'scipy': No module named 'scipy'
SKIPPED [2] networkx/algorithms/tests/test_similarity.py:674: could not import 'scipy': No module named 'scipy'
SKIPPED [2] networkx/algorithms/tests/test_similarity.py:697: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:702: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:732: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:776: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:790: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:796: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:809: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:822: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:860: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:901: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_threshold.py:251: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_tournament.py:127: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tree/tests/test_mst.py:464: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tree/tests/test_mst.py:492: need --runslow option to run
SKIPPED [1] networkx/algorithms/tree/tests/test_mst.py:588: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tree/tests/test_mst.py:618: need --runslow option to run
SKIPPED [5] networkx/generators/tests/test_expanders.py:25: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_algebraic_connectivity.py:15: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_algebraic_connectivity.py:23: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_algebraic_connectivity.py:31: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_algebraic_connectivity.py:39: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_algebraic_connectivity.py:50: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_algebraic_connectivity.py:105: could not import 'scipy': No module named 'scipy'
SKIPPED [4] networkx/linalg/tests/test_algebraic_connectivity.py:112: could not import 'scipy': No module named 'scipy'
SKIPPED [4] networkx/linalg/tests/test_algebraic_connectivity.py:124: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_algebraic_connectivity.py:137: could not import 'scipy': No module named 'scipy'
SKIPPED [4] networkx/linalg/tests/test_algebraic_connectivity.py:148: could not import 'scipy': No module named 'scipy'
SKIPPED [4] networkx/linalg/tests/test_algebraic_connectivity.py:159: could not import 'scipy': No module named 'scipy'
SKIPPED [4] networkx/linalg/tests/test_algebraic_connectivity.py:171: could not import 'scipy': No module named 'scipy'
SKIPPED [4] networkx/linalg/tests/test_algebraic_connectivity.py:182: could not import 'scipy': No module named 'scipy'
SKIPPED [8] networkx/linalg/tests/test_algebraic_connectivity.py:200: could not import 'scipy': No module named 'scipy'
SKIPPED [4] networkx/linalg/tests/test_algebraic_connectivity.py:333: could not import 'scipy': No module named 'scipy'
SKIPPED [4] networkx/linalg/tests/test_algebraic_connectivity.py:342: could not import 'scipy': No module named 'scipy'
SKIPPED [4] networkx/linalg/tests/test_algebraic_connectivity.py:351: could not import 'scipy': No module named 'scipy'
SKIPPED [4] networkx/linalg/tests/test_algebraic_connectivity.py:361: could not import 'scipy': No module named 'scipy'
SKIPPED [4] networkx/linalg/tests/test_algebraic_connectivity.py:371: could not import 'scipy': No module named 'scipy'
SKIPPED [8] networkx/linalg/tests/test_algebraic_connectivity.py:395: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_attrmatrix.py:80: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_attrmatrix.py:94: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/tests/test_all_random_functions.py:222: need --runslow option to run
FAILED networkx/algorithms/components/tests/test_strongly_connected.py::TestStronglyConnected::test_connected_raise - Failed: DID NOT WARN. No warnings of type (<class 'DeprecationWarning'>, <class 'PendingDeprecationWarning'>, <class 'FutureWarning'>) were emitted.
FAILED networkx/algorithms/tests/test_cycles.py::TestMinimumCycleBasis::test_dimensionality - ModuleNotFoundError: No module named 'scipy'
FAILED networkx/algorithms/tests/test_cycles.py::TestMinimumCycleBasis::test_complete_graph - ModuleNotFoundError: No module named 'scipy'
FAILED networkx/algorithms/tests/test_cycles.py::TestMinimumCycleBasis::test_petersen_graph - ModuleNotFoundError: No module named 'scipy'
FAILED networkx/algorithms/tests/test_cycles.py::TestMinimumCycleBasis::test_gh6787_variable_weighted_complete_graph - ModuleNotFoundError: No module named 'scipy'
FAILED networkx/algorithms/tests/test_distance_measures.py::TestResistanceDistance::test_resistance_distance - ModuleNotFoundError: No module named 'scipy'
FAILED networkx/algorithms/tests/test_distance_measures.py::TestResistanceDistance::test_resistance_distance_noinv - ModuleNotFoundError: No module named 'scipy'
FAILED networkx/algorithms/tests/test_distance_measures.py::TestResistanceDistance::test_resistance_distance_no_weight - ModuleNotFoundError: No module named 'scipy'
FAILED networkx/algorithms/tests/test_distance_measures.py::TestResistanceDistance::test_resistance_distance_neg_weight - ModuleNotFoundError: No module named 'scipy'
FAILED networkx/algorithms/tests/test_distance_measures.py::TestResistanceDistance::test_multigraph - ModuleNotFoundError: No module named 'scipy'
FAILED networkx/algorithms/tests/test_distance_measures.py::TestResistanceDistance::test_resistance_distance_same_node - ModuleNotFoundError: No module named 'scipy'
FAILED networkx/algorithms/tests/test_distance_measures.py::TestResistanceDistance::test_resistance_distance_only_nodeA - ModuleNotFoundError: No module named 'scipy'
FAILED networkx/algorithms/tests/test_distance_measures.py::TestResistanceDistance::test_resistance_distance_only_nodeB - ModuleNotFoundError: No module named 'scipy'
FAILED networkx/algorithms/tests/test_distance_measures.py::TestResistanceDistance::test_resistance_distance_all - ModuleNotFoundError: No module named 'scipy'
FAILED networkx/algorithms/tests/test_distance_measures.py::TestKemenyConstant::test_kemeny_constant_not_connected - ModuleNotFoundError: No module named 'scipy'
FAILED networkx/algorithms/tests/test_distance_measures.py::TestKemenyConstant::test_kemeny_constant_no_nodes - ModuleNotFoundError: No module named 'scipy'
FAILED networkx/algorithms/tests/test_distance_measures.py::TestKemenyConstant::test_kemeny_constant_negative_weight - ModuleNotFoundError: No module named 'scipy'
FAILED networkx/algorithms/tests/test_distance_measures.py::TestKemenyConstant::test_kemeny_constant - ModuleNotFoundError: No module named 'scipy'
FAILED networkx/algorithms/tests/test_distance_measures.py::TestKemenyConstant::test_kemeny_constant_no_weight - ModuleNotFoundError: No module named 'scipy'
FAILED networkx/algorithms/tests/test_distance_measures.py::TestKemenyConstant::test_kemeny_constant_multigraph - ModuleNotFoundError: No module named 'scipy'
FAILED networkx/algorithms/tests/test_distance_measures.py::TestKemenyConstant::test_kemeny_constant_weight0 - ModuleNotFoundError: No module named 'scipy'
FAILED networkx/algorithms/tests/test_distance_measures.py::TestKemenyConstant::test_kemeny_constant_selfloop - ModuleNotFoundError: No module named 'scipy'
FAILED networkx/algorithms/tests/test_distance_measures.py::TestKemenyConstant::test_kemeny_constant_complete_bipartite_graph - ModuleNotFoundError: No module named 'scipy'
FAILED networkx/algorithms/tests/test_distance_measures.py::TestKemenyConstant::test_kemeny_constant_path_graph - ModuleNotFoundError: No module named 'scipy'
=========================================================== 24 failed, 4684 passed, 197 skipped, 20 warnings in 123.65s (0:02:03) ===========================================================
```
</details>

With below patch
<details>

```patch
--- a/networkx/algorithms/tests/test_cycles.py
+++ b/networkx/algorithms/tests/test_cycles.py
@@ -870,6 +870,7 @@
         assert_basis_equal(mcb, [[2, 4, 1], [4, 3, 2, 1]])

     def test_dimensionality(self):
+        pytest.importorskip("scipy")
         # checks |MCB|=|E|-|V|+|NC|
         ntrial = 10
         for seed in range(1234, 1234 + ntrial):
@@ -883,6 +884,7 @@
             check_independent(mcb)

     def test_complete_graph(self):
+        pytest.importorskip("scipy")
         cg = nx.complete_graph(5)
         mcb = nx.minimum_cycle_basis(cg)
         assert all(len(cycle) == 3 for cycle in mcb)
@@ -893,6 +895,7 @@
         assert not nx.minimum_cycle_basis(tg)

     def test_petersen_graph(self):
+        pytest.importorskip("scipy")
         G = nx.petersen_graph()
         mcb = list(nx.minimum_cycle_basis(G))
         expected = [
@@ -913,6 +916,7 @@
         check_independent(mcb)

     def test_gh6787_variable_weighted_complete_graph(self):
+        pytest.importorskip("scipy")
         N = 8
         cg = nx.complete_graph(N)
         cg.add_weighted_edges_from([(u, v, 9) for u, v in cg.edges])
--- a/networkx/algorithms/tests/test_distance_measures.py
+++ b/networkx/algorithms/tests/test_distance_measures.py
@@ -334,6 +334,7 @@
         self.G = G

     def test_resistance_distance_directed_graph(self):
+        pytest.importorskip("scipy")
         G = nx.DiGraph()
         with pytest.raises(nx.NetworkXNotImplemented):
             nx.resistance_distance(G)
@@ -362,21 +363,25 @@
         assert round(rd, 5) == round(test_data, 5)

     def test_resistance_distance_noinv(self):
+        pytest.importorskip("scipy")
         rd = nx.resistance_distance(self.G, 1, 3, "weight", False)
         test_data = 1 / (1 / (1 / 2 + 1 / 4) + 1 / (1 / 1 + 1 / 3))
         assert round(rd, 5) == round(test_data, 5)

     def test_resistance_distance_no_weight(self):
+        pytest.importorskip("scipy")
         rd = nx.resistance_distance(self.G, 1, 3)
         assert round(rd, 5) == 1

     def test_resistance_distance_neg_weight(self):
+        pytest.importorskip("scipy")
         self.G[2][3]["weight"] = -4
         rd = nx.resistance_distance(self.G, 1, 3, "weight", True)
         test_data = 1 / (1 / (2 + -4) + 1 / (1 + 3))
         assert round(rd, 5) == round(test_data, 5)

     def test_multigraph(self):
+        pytest.importorskip("scipy")
         G = nx.MultiGraph()
         G.add_edge(1, 2, weight=2)
         G.add_edge(2, 3, weight=4)
@@ -391,9 +396,11 @@
             nx.resistance_distance(self.G, 1, 3, "weight")

     def test_resistance_distance_same_node(self):
+        pytest.importorskip("scipy")
         assert nx.resistance_distance(self.G, 1, 1) == 0

     def test_resistance_distance_only_nodeA(self):
+        pytest.importorskip("scipy")
         rd = nx.resistance_distance(self.G, nodeA=1)
         test_data = {}
         test_data[1] = 0
@@ -406,6 +413,7 @@
             assert np.isclose(rd[key], test_data[key])

     def test_resistance_distance_only_nodeB(self):
+        pytest.importorskip("scipy")
         rd = nx.resistance_distance(self.G, nodeB=1)
         test_data = {}
         test_data[1] = 0
@@ -418,6 +426,7 @@
             assert np.isclose(rd[key], test_data[key])

     def test_resistance_distance_all(self):
+        pytest.importorskip("scipy")
         rd = nx.resistance_distance(self.G)
         assert type(rd) == dict
         assert round(rd[1][3], 5) == 1
@@ -535,16 +544,19 @@
             nx.kemeny_constant(G)

     def test_kemeny_constant_not_connected(self):
+        pytest.importorskip("scipy")
         self.G.add_node(5)
         with pytest.raises(nx.NetworkXError):
             nx.kemeny_constant(self.G)

     def test_kemeny_constant_no_nodes(self):
+        pytest.importorskip("scipy")
         G = nx.Graph()
         with pytest.raises(nx.NetworkXError):
             nx.kemeny_constant(G)

     def test_kemeny_constant_negative_weight(self):
+        pytest.importorskip("scipy")
         G = nx.Graph()
         w12 = 2
         w13 = 3
@@ -556,6 +568,7 @@
             nx.kemeny_constant(G, weight="weight")

     def test_kemeny_constant(self):
+        pytest.importorskip("scipy")
         K = nx.kemeny_constant(self.G, weight="weight")
         w12 = 2
         w13 = 3
@@ -576,10 +589,12 @@
         assert np.isclose(K, test_data)

     def test_kemeny_constant_no_weight(self):
+        pytest.importorskip("scipy")
         K = nx.kemeny_constant(self.G)
         assert np.isclose(K, 4 / 3)

     def test_kemeny_constant_multigraph(self):
+        pytest.importorskip("scipy")
         G = nx.MultiGraph()
         w12_1 = 2
         w12_2 = 1
@@ -607,6 +622,7 @@
         assert np.isclose(K, test_data)

     def test_kemeny_constant_weight0(self):
+        pytest.importorskip("scipy")
         G = nx.Graph()
         w12 = 0
         w13 = 3
@@ -631,6 +647,7 @@
         assert np.isclose(K, test_data)

     def test_kemeny_constant_selfloop(self):
+        pytest.importorskip("scipy")
         G = nx.Graph()
         w11 = 1
         w12 = 2
@@ -653,6 +670,7 @@
         assert np.isclose(K, test_data)

     def test_kemeny_constant_complete_bipartite_graph(self):
+        pytest.importorskip("scipy")
         # Theorem 1 in https://www.sciencedirect.com/science/article/pii/S0166218X20302912
         n1 = 5
         n2 = 4
@@ -661,6 +679,7 @@
         assert np.isclose(K, n1 + n2 - 3 / 2)

     def test_kemeny_constant_path_graph(self):
+        pytest.importorskip("scipy")
         # Theorem 2 in https://www.sciencedirect.com/science/article/pii/S0166218X20302912
         n = 10
         G = nx.path_graph(n)
```
</details>

Still I have two units failing
<details>
<summary>Here is pytest output:</summary>

```console
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-networkx-3.2.1-5.fc36.x86_64/usr/lib64/python3.9/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-networkx-3.2.1-5.fc36.x86_64/usr/lib/python3.9/site-packages
+ /usr/bin/pytest -ra -m 'not network' --ignore networkx/drawing/tests/test_pylab.py
============================= test session starts ==============================
platform linux -- Python 3.9.18, pytest-8.1.1, pluggy-1.4.0
rootdir: /home/tkloczko/rpmbuild/BUILD/networkx-networkx-3.2.1
configfile: pyproject.toml
collected 4877 items / 28 skipped

networkx/algorithms/approximation/tests/test_approx_clust_coeff.py ..... [  0%]
.                                                                        [  0%]
networkx/algorithms/approximation/tests/test_clique.py ........          [  0%]
networkx/algorithms/approximation/tests/test_connectivity.py ........... [  0%]
.......                                                                  [  0%]
networkx/algorithms/approximation/tests/test_distance_measures.py ...... [  0%]
..                                                                       [  0%]
networkx/algorithms/approximation/tests/test_dominating_set.py ....      [  0%]
networkx/algorithms/approximation/tests/test_kcomponents.py ............ [  1%]
....                                                                     [  1%]
networkx/algorithms/approximation/tests/test_matching.py .               [  1%]
networkx/algorithms/approximation/tests/test_maxcut.py .....             [  1%]
networkx/algorithms/approximation/tests/test_ramsey.py .                 [  1%]
networkx/algorithms/approximation/tests/test_steinertree.py ....         [  1%]
networkx/algorithms/approximation/tests/test_traveling_salesman.py ..... [  1%]
.......................ssssssssss...s.                                   [  2%]
networkx/algorithms/approximation/tests/test_treewidth.py .............. [  2%]
                                                                         [  2%]
networkx/algorithms/approximation/tests/test_vertex_cover.py ....        [  2%]
networkx/algorithms/assortativity/tests/test_connectivity.py ..........  [  2%]
networkx/algorithms/assortativity/tests/test_mixing.py ................. [  3%]
..                                                                       [  3%]
networkx/algorithms/assortativity/tests/test_neighbor_degree.py ......   [  3%]
networkx/algorithms/assortativity/tests/test_pairs.py ...........        [  3%]
networkx/algorithms/bipartite/tests/test_basic.py ............sss        [  3%]
networkx/algorithms/bipartite/tests/test_centrality.py .......           [  4%]
networkx/algorithms/bipartite/tests/test_cluster.py .........            [  4%]
networkx/algorithms/bipartite/tests/test_covering.py ....                [  4%]
networkx/algorithms/bipartite/tests/test_edgelist.py ...............     [  4%]
networkx/algorithms/bipartite/tests/test_extendability.py ...........    [  4%]
networkx/algorithms/bipartite/tests/test_generators.py ..........        [  5%]
networkx/algorithms/bipartite/tests/test_matching.py ............sssssss [  5%]
s                                                                        [  5%]
networkx/algorithms/bipartite/tests/test_project.py ..................   [  5%]
networkx/algorithms/bipartite/tests/test_redundancy.py ...               [  5%]
networkx/algorithms/centrality/tests/test_betweenness_centrality.py .... [  6%]
.....................................                                    [  6%]
networkx/algorithms/centrality/tests/test_betweenness_centrality_subset.py . [  6%]
.....................                                                    [  7%]
networkx/algorithms/centrality/tests/test_closeness_centrality.py ...... [  7%]
.......                                                                  [  7%]
networkx/algorithms/centrality/tests/test_degree_centrality.py .......   [  7%]
networkx/algorithms/centrality/tests/test_dispersion.py ....             [  7%]
networkx/algorithms/centrality/tests/test_group.py ..................... [  8%]
...                                                                      [  8%]
networkx/algorithms/centrality/tests/test_harmonic_centrality.py ....... [  8%]
......                                                                   [  8%]
networkx/algorithms/centrality/tests/test_katz_centrality.py ..........s [  8%]
ssssssssss..sss                                                          [  9%]
networkx/algorithms/centrality/tests/test_load_centrality.py ........... [  9%]
.......                                                                  [  9%]
networkx/algorithms/centrality/tests/test_percolation_centrality.py .... [  9%]
                                                                         [  9%]
networkx/algorithms/centrality/tests/test_reaching.py ...............    [  9%]
networkx/algorithms/centrality/tests/test_voterank.py ......             [  9%]
networkx/algorithms/coloring/tests/test_coloring.py .................    [ 10%]
networkx/algorithms/community/tests/test_asyn_fluid.py .....             [ 10%]
networkx/algorithms/community/tests/test_centrality.py .....             [ 10%]
networkx/algorithms/community/tests/test_kclique.py ........             [ 10%]
networkx/algorithms/community/tests/test_kernighan_lin.py ........       [ 10%]
networkx/algorithms/community/tests/test_label_propagation.py .......... [ 10%]
.............                                                            [ 11%]
networkx/algorithms/community/tests/test_louvain.py .............        [ 11%]
networkx/algorithms/community/tests/test_lukes.py ....                   [ 11%]
networkx/algorithms/community/tests/test_modularity_max.py ............. [ 11%]
.....                                                                    [ 11%]
networkx/algorithms/community/tests/test_quality.py .......              [ 12%]
networkx/algorithms/community/tests/test_utils.py ....                   [ 12%]
networkx/algorithms/components/tests/test_attracting.py ....             [ 12%]
networkx/algorithms/components/tests/test_biconnected.py .............   [ 12%]
networkx/algorithms/components/tests/test_connected.py .........         [ 12%]
networkx/algorithms/components/tests/test_semiconnected.py ........      [ 12%]
networkx/algorithms/components/tests/test_strongly_connected.py ........ [ 13%]
..F..                                                                    [ 13%]
networkx/algorithms/components/tests/test_weakly_connected.py ......     [ 13%]
networkx/algorithms/connectivity/tests/test_connectivity.py ............ [ 13%]
......................                                                   [ 13%]
networkx/algorithms/connectivity/tests/test_cuts.py .................... [ 14%]
.                                                                        [ 14%]
networkx/algorithms/connectivity/tests/test_disjoint_paths.py .......... [ 14%]
........                                                                 [ 14%]
networkx/algorithms/connectivity/tests/test_edge_augmentation.py ....... [ 14%]
.............                                                            [ 15%]
networkx/algorithms/connectivity/tests/test_edge_kcomponents.py ........ [ 15%]
.............                                                            [ 15%]
networkx/algorithms/connectivity/tests/test_kcomponents.py .sss......    [ 15%]
networkx/algorithms/connectivity/tests/test_kcutsets.py s........s.....  [ 16%]
networkx/algorithms/connectivity/tests/test_stoer_wagner.py .....        [ 16%]
networkx/algorithms/flow/tests/test_gomory_hu.py ....s....               [ 16%]
networkx/algorithms/flow/tests/test_maxflow.py ......................... [ 16%]
..                                                                       [ 16%]
networkx/algorithms/flow/tests/test_maxflow_large_graph.py ...s..        [ 17%]
networkx/algorithms/flow/tests/test_mincost.py ...................       [ 17%]
networkx/algorithms/flow/tests/test_networksimplex.py .................. [ 17%]
....                                                                     [ 17%]
networkx/algorithms/isomorphism/tests/test_ismags.py ..........          [ 18%]
networkx/algorithms/isomorphism/tests/test_isomorphism.py ....           [ 18%]
networkx/algorithms/isomorphism/tests/test_isomorphvf2.py .............. [ 18%]
..                                                                       [ 18%]
networkx/algorithms/isomorphism/tests/test_match_helpers.py ..           [ 18%]
networkx/algorithms/isomorphism/tests/test_temporalisomorphvf2.py ...... [ 18%]
......                                                                   [ 18%]
networkx/algorithms/isomorphism/tests/test_tree_isomorphism.py .....     [ 18%]
networkx/algorithms/isomorphism/tests/test_vf2pp.py .................... [ 19%]
........................                                                 [ 19%]
networkx/algorithms/isomorphism/tests/test_vf2pp_helpers.py ............ [ 20%]
.................................                                        [ 20%]
networkx/algorithms/isomorphism/tests/test_vf2userfunc.py .............. [ 21%]
..............                                                           [ 21%]
networkx/algorithms/minors/tests/test_contraction.py ................... [ 21%]
............                                                             [ 21%]
networkx/algorithms/operators/tests/test_all.py ...................      [ 22%]
networkx/algorithms/operators/tests/test_binary.py ....................  [ 22%]
networkx/algorithms/operators/tests/test_product.py .................... [ 23%]
........                                                                 [ 23%]
networkx/algorithms/operators/tests/test_unary.py ...                    [ 23%]
networkx/algorithms/shortest_paths/tests/test_astar.py ................  [ 23%]
networkx/algorithms/shortest_paths/tests/test_dense.py ........          [ 23%]
networkx/algorithms/shortest_paths/tests/test_dense_numpy.py .......     [ 24%]
networkx/algorithms/shortest_paths/tests/test_generic.py ............... [ 24%]
...........                                                              [ 24%]
networkx/algorithms/shortest_paths/tests/test_unweighted.py ............ [ 24%]
.....                                                                    [ 24%]
networkx/algorithms/shortest_paths/tests/test_weighted.py .............. [ 25%]
..........................................                               [ 26%]
networkx/algorithms/tests/test_asteroidal.py .                           [ 26%]
networkx/algorithms/tests/test_boundary.py .............                 [ 26%]
networkx/algorithms/tests/test_bridges.py ..........                     [ 26%]
networkx/algorithms/tests/test_chains.py .....                           [ 26%]
networkx/algorithms/tests/test_chordal.py ..........                     [ 26%]
networkx/algorithms/tests/test_clique.py ............                    [ 27%]
networkx/algorithms/tests/test_cluster.py .............................. [ 27%]
.............                                                            [ 28%]
networkx/algorithms/tests/test_core.py ...............                   [ 28%]
networkx/algorithms/tests/test_covering.py ...........                   [ 28%]
networkx/algorithms/tests/test_cuts.py .................                 [ 28%]
networkx/algorithms/tests/test_cycles.py ............................... [ 29%]
...............ss.ss..........                                           [ 30%]
networkx/algorithms/tests/test_d_separation.py ...............           [ 30%]
networkx/algorithms/tests/test_dag.py .................................. [ 31%]
..........................                                               [ 31%]
networkx/algorithms/tests/test_distance_measures.py .................... [ 32%]
.....................s....Fssss.ssss.....ssssssssss                      [ 33%]
networkx/algorithms/tests/test_distance_regular.py .......               [ 33%]
networkx/algorithms/tests/test_dominance.py ......................       [ 33%]
networkx/algorithms/tests/test_dominating.py .....                       [ 33%]
networkx/algorithms/tests/test_efficiency.py .......                     [ 33%]
networkx/algorithms/tests/test_euler.py ................................ [ 34%]
                                                                         [ 34%]
networkx/algorithms/tests/test_graph_hashing.py ........................ [ 35%]
                                                                         [ 35%]
networkx/algorithms/tests/test_graphical.py .............                [ 35%]
networkx/algorithms/tests/test_hierarchy.py .....                        [ 35%]
networkx/algorithms/tests/test_hybrid.py ..                              [ 35%]
networkx/algorithms/tests/test_isolate.py ...                            [ 35%]
networkx/algorithms/tests/test_link_prediction.py ...................... [ 36%]
...................................................                      [ 37%]
networkx/algorithms/tests/test_lowest_common_ancestors.py .............. [ 37%]
.........................................                                [ 38%]
networkx/algorithms/tests/test_matching.py ............................. [ 38%]
...................                                                      [ 39%]
networkx/algorithms/tests/test_max_weight_clique.py .....                [ 39%]
networkx/algorithms/tests/test_mis.py .......                            [ 39%]
networkx/algorithms/tests/test_moral.py .                                [ 39%]
networkx/algorithms/tests/test_non_randomness.py ......                  [ 39%]
networkx/algorithms/tests/test_planar_drawing.py ............            [ 39%]
networkx/algorithms/tests/test_planarity.py ............................ [ 40%]
..                                                                       [ 40%]
networkx/algorithms/tests/test_reciprocity.py .....                      [ 40%]
networkx/algorithms/tests/test_regular.py .............                  [ 40%]
networkx/algorithms/tests/test_richclub.py .........                     [ 41%]
networkx/algorithms/tests/test_similarity.py sssssssssssssssssssssssssss [ 41%]
ssssssssssssssssss                                                       [ 41%]
networkx/algorithms/tests/test_simple_paths.py ......................... [ 42%]
.................................................                        [ 43%]
networkx/algorithms/tests/test_smallworld.py ......                      [ 43%]
networkx/algorithms/tests/test_smetric.py ..                             [ 43%]
networkx/algorithms/tests/test_sparsifiers.py .......                    [ 43%]
networkx/algorithms/tests/test_structuralholes.py .............          [ 44%]
networkx/algorithms/tests/test_summarization.py .................        [ 44%]
networkx/algorithms/tests/test_swap.py .....................             [ 44%]
networkx/algorithms/tests/test_threshold.py ................s.           [ 45%]
networkx/algorithms/tests/test_time_dependent.py ............            [ 45%]
networkx/algorithms/tests/test_tournament.py ...............s.....       [ 45%]
networkx/algorithms/tests/test_triads.py ................                [ 46%]
networkx/algorithms/tests/test_vitality.py ......                        [ 46%]
networkx/algorithms/tests/test_voronoi.py ..........                     [ 46%]
networkx/algorithms/tests/test_wiener.py ....                            [ 46%]
networkx/algorithms/traversal/tests/test_beamsearch.py ...               [ 46%]
networkx/algorithms/traversal/tests/test_bfs.py ...................      [ 47%]
networkx/algorithms/traversal/tests/test_dfs.py ..................       [ 47%]
networkx/algorithms/traversal/tests/test_edgebfs.py ................     [ 47%]
networkx/algorithms/traversal/tests/test_edgedfs.py ...............      [ 48%]
networkx/algorithms/tree/tests/test_branchings.py ...................... [ 48%]
..........                                                               [ 48%]
networkx/algorithms/tree/tests/test_coding.py ..............             [ 48%]
networkx/algorithms/tree/tests/test_decomposition.py .....               [ 49%]
networkx/algorithms/tree/tests/test_mst.py ............................. [ 49%]
.......................ssss                                              [ 50%]
networkx/algorithms/tree/tests/test_operations.py ....                   [ 50%]
networkx/algorithms/tree/tests/test_recognition.py ..................... [ 50%]
....                                                                     [ 50%]
networkx/classes/tests/test_coreviews.py ............................... [ 51%]
.........................                                                [ 51%]
networkx/classes/tests/test_digraph.py ................................. [ 52%]
...................................................                      [ 53%]
networkx/classes/tests/test_digraph_historical.py ...................... [ 54%]
....................                                                     [ 54%]
networkx/classes/tests/test_filters.py ...........                       [ 54%]
networkx/classes/tests/test_function.py ................................ [ 55%]
.......................................                                  [ 56%]
networkx/classes/tests/test_graph.py ................................... [ 56%]
.............................                                            [ 57%]
networkx/classes/tests/test_graph_historical.py ........................ [ 58%]
..........                                                               [ 58%]
networkx/classes/tests/test_graphviews.py .............................. [ 58%]
.....                                                                    [ 58%]
networkx/classes/tests/test_multidigraph.py ............................ [ 59%]
........................................................................ [ 61%]
........................................................................ [ 62%]
...............                                                          [ 62%]
networkx/classes/tests/test_multigraph.py .............................. [ 63%]
........................................................................ [ 64%]
...................................................                      [ 65%]
networkx/classes/tests/test_reportviews.py ............................. [ 66%]
........................................................................ [ 68%]
........................................................................ [ 69%]
....................................................................     [ 70%]
networkx/classes/tests/test_special.py ................................. [ 71%]
........................................................................ [ 73%]
........................................................................ [ 74%]
........................................................................ [ 75%]
........................................................................ [ 77%]
...........................                                              [ 78%]
networkx/classes/tests/test_subgraphviews.py ........................... [ 78%]
.....                                                                    [ 78%]
networkx/drawing/tests/test_latex.py ......                              [ 78%]
networkx/generators/tests/test_atlas.py ........                         [ 78%]
networkx/generators/tests/test_classic.py .............................. [ 79%]
..............                                                           [ 79%]
networkx/generators/tests/test_cographs.py .                             [ 79%]
networkx/generators/tests/test_community.py ......................       [ 80%]
networkx/generators/tests/test_degree_seq.py ...................         [ 80%]
networkx/generators/tests/test_directed.py ..............                [ 81%]
networkx/generators/tests/test_duplication.py .......                    [ 81%]
networkx/generators/tests/test_ego.py ..                                 [ 81%]
networkx/generators/tests/test_expanders.py .....sssss................   [ 81%]
networkx/generators/tests/test_geometric.py ............................ [ 82%]
..                                                                       [ 82%]
networkx/generators/tests/test_harary_graph.py ..                        [ 82%]
networkx/generators/tests/test_internet_as_graphs.py .....               [ 82%]
networkx/generators/tests/test_intersection.py ....                      [ 82%]
networkx/generators/tests/test_interval_graph.py ........                [ 82%]
networkx/generators/tests/test_joint_degree_seq.py ....                  [ 82%]
networkx/generators/tests/test_lattice.py .......................        [ 83%]
networkx/generators/tests/test_line.py ................................. [ 83%]
..                                                                       [ 84%]
networkx/generators/tests/test_mycielski.py ...                          [ 84%]
networkx/generators/tests/test_nonisomorphic_trees.py .....              [ 84%]
networkx/generators/tests/test_random_clustered.py ....                  [ 84%]
networkx/generators/tests/test_random_graphs.py ........................ [ 84%]
.............................................                            [ 85%]
networkx/generators/tests/test_small.py ................................ [ 86%]
......                                                                   [ 86%]
networkx/generators/tests/test_stochastic.py .......                     [ 86%]
networkx/generators/tests/test_sudoku.py ......                          [ 86%]
networkx/generators/tests/test_time_series.py .......                    [ 86%]
networkx/generators/tests/test_trees.py ..................               [ 87%]
networkx/generators/tests/test_triads.py ..                              [ 87%]
networkx/linalg/tests/test_algebraic_connectivity.py sssss............ss [ 87%]
ssssssssssssssssssssssssssssssss.........ssssssssssssssssssssssssssss    [ 89%]
networkx/linalg/tests/test_attrmatrix.py ...ss                           [ 89%]
networkx/readwrite/json_graph/tests/test_adjacency.py ........           [ 89%]
networkx/readwrite/json_graph/tests/test_cytoscape.py .......            [ 89%]
networkx/readwrite/json_graph/tests/test_node_link.py ...........        [ 89%]
networkx/readwrite/json_graph/tests/test_tree.py ...                     [ 89%]
networkx/readwrite/tests/test_adjlist.py ..................              [ 90%]
networkx/readwrite/tests/test_edgelist.py ..........................     [ 90%]
networkx/readwrite/tests/test_gexf.py .....................              [ 91%]
networkx/readwrite/tests/test_gml.py .........................           [ 91%]
networkx/readwrite/tests/test_graph6.py ...............................  [ 92%]
networkx/readwrite/tests/test_graphml.py ............................... [ 92%]
............................                                             [ 93%]
networkx/readwrite/tests/test_leda.py ..                                 [ 93%]
networkx/readwrite/tests/test_p2g.py ...                                 [ 93%]
networkx/readwrite/tests/test_pajek.py ........                          [ 93%]
networkx/readwrite/tests/test_sparse6.py ................                [ 94%]
networkx/readwrite/tests/test_text.py .................................  [ 94%]
networkx/tests/test_all_random_functions.py s                            [ 94%]
networkx/tests/test_convert.py ...............                           [ 95%]
networkx/tests/test_convert_numpy.py ................................... [ 95%]
...............                                                          [ 96%]
networkx/tests/test_convert_pandas.py ......................             [ 96%]
networkx/tests/test_exceptions.py .......                                [ 96%]
networkx/tests/test_import.py ..                                         [ 96%]
networkx/tests/test_lazy_imports.py ....                                 [ 96%]
networkx/tests/test_relabel.py ..............................            [ 97%]
networkx/utils/tests/test__init.py .                                     [ 97%]
networkx/utils/tests/test_decorators.py ................................ [ 98%]
...                                                                      [ 98%]
networkx/utils/tests/test_heaps.py ..                                    [ 98%]
networkx/utils/tests/test_mapped_queue.py .............................. [ 98%]
................                                                         [ 99%]
networkx/utils/tests/test_misc.py ...............................        [ 99%]
networkx/utils/tests/test_random_sequence.py ....                        [ 99%]
networkx/utils/tests/test_rcm.py ..                                      [ 99%]
networkx/utils/tests/test_unionfind.py .....                             [100%]

=================================== FAILURES ===================================
__________________ TestStronglyConnected.test_connected_raise __________________

self = <networkx.algorithms.components.tests.test_strongly_connected.TestStronglyConnected object at 0x7fe5866e5d30>

    def test_connected_raise(self):
        G = nx.Graph()
        with pytest.raises(NetworkXNotImplemented):
            next(nx.strongly_connected_components(G))
        with pytest.raises(NetworkXNotImplemented):
            next(nx.kosaraju_strongly_connected_components(G))
        with pytest.raises(NetworkXNotImplemented):
            with pytest.deprecated_call():
>               next(nx.strongly_connected_components_recursive(G))

networkx/algorithms/components/tests/test_strongly_connected.py:187:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
<class 'networkx.utils.decorators.argmap'> compilation 498:3: in argmap_strongly_connected_components_recursive_495
    import gzip
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

g = <networkx.classes.graph.Graph object at 0x7fe585274df0>

    def _not_implemented_for(g):
        if (mval is None or mval == g.is_multigraph()) and (
            dval is None or dval == g.is_directed()
        ):
>           raise nx.NetworkXNotImplemented(errmsg)
E           networkx.exception.NetworkXNotImplemented: not implemented for undirected type

networkx/utils/decorators.py:90: NetworkXNotImplemented

During handling of the above exception, another exception occurred:

self = <networkx.algorithms.components.tests.test_strongly_connected.TestStronglyConnected object at 0x7fe5866e5d30>

    def test_connected_raise(self):
        G = nx.Graph()
        with pytest.raises(NetworkXNotImplemented):
            next(nx.strongly_connected_components(G))
        with pytest.raises(NetworkXNotImplemented):
            next(nx.kosaraju_strongly_connected_components(G))
        with pytest.raises(NetworkXNotImplemented):
            with pytest.deprecated_call():
>               next(nx.strongly_connected_components_recursive(G))
E               Failed: DID NOT WARN. No warnings of type (<class 'DeprecationWarning'>, <class 'PendingDeprecationWarning'>, <class 'FutureWarning'>) were emitted.
E                Emitted warnings: [].

networkx/algorithms/components/tests/test_strongly_connected.py:187: Failed
_______________ TestResistanceDistance.test_resistance_distance ________________

self = <networkx.algorithms.tests.test_distance_measures.TestResistanceDistance object at 0x7fe586613490>

    def test_resistance_distance(self):
>       rd = nx.resistance_distance(self.G, 1, 3, "weight", True)

networkx/algorithms/tests/test_distance_measures.py:361:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
<class 'networkx.utils.decorators.argmap'> compilation 909:4: in argmap_resistance_distance_906
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
networkx/algorithms/distance_measures.py:744: in resistance_distance
    L = nx.laplacian_matrix(G, weight=weight).todense()
networkx/utils/decorators.py:770: in func
    return argmap._lazy_compile(__wrapper)(*args, **kwargs)
<class 'networkx.utils.decorators.argmap'> compilation 913:4: in argmap_laplacian_matrix_910
    ???
networkx/utils/backends.py:576: in __call__
    return self.orig_func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

G = <networkx.classes.graph.Graph object at 0x7fe5824015b0>, nodelist = None
weight = 'weight'

    @not_implemented_for("directed")
    @nx._dispatch(edge_attrs="weight")
    def laplacian_matrix(G, nodelist=None, weight="weight"):
        """Returns the Laplacian matrix of G.

        The graph Laplacian is the matrix L = D - A, where
        A is the adjacency matrix and D is the diagonal matrix of node degrees.

        Parameters
        ----------
        G : graph
           A NetworkX graph

        nodelist : list, optional
           The rows and columns are ordered according to the nodes in nodelist.
           If nodelist is None, then the ordering is produced by G.nodes().

        weight : string or None, optional (default='weight')
           The edge data key used to compute each value in the matrix.
           If None, then each edge has weight 1.

        Returns
        -------
        L : SciPy sparse array
          The Laplacian matrix of G.

        Notes
        -----
        For MultiGraph, the edges weights are summed.

        See Also
        --------
        :func:`~networkx.convert_matrix.to_numpy_array`
        normalized_laplacian_matrix
        :func:`~networkx.linalg.spectrum.laplacian_spectrum`

        Examples
        --------
        For graphs with multiple connected components, L is permutation-similar
        to a block diagonal matrix where each block is the respective Laplacian
        matrix for each component.

        >>> G = nx.Graph([(1, 2), (2, 3), (4, 5)])
        >>> print(nx.laplacian_matrix(G).toarray())
        [[ 1 -1  0  0  0]
         [-1  2 -1  0  0]
         [ 0 -1  1  0  0]
         [ 0  0  0  1 -1]
         [ 0  0  0 -1  1]]

        """
>       import scipy as sp
E       ModuleNotFoundError: No module named 'scipy'

networkx/linalg/laplacianmatrix.py:66: ModuleNotFoundError
=============================== warnings summary ===============================
networkx/utils/backends.py:135
  /home/tkloczko/rpmbuild/BUILD/networkx-networkx-3.2.1/networkx/utils/backends.py:135: RuntimeWarning: networkx backend defined more than once: nx-loopback
    backends.update(_get_backends("networkx.backends"))

networkx/utils/backends.py:576
  /home/tkloczko/rpmbuild/BUILD/networkx-networkx-3.2.1/networkx/utils/backends.py:576: DeprecationWarning:

  random_tree is deprecated and will be removed in NX v3.4
  Use random_labeled_tree instead.
    return self.orig_func(*args, **kwargs)

networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_single_node
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_with_c
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_normalized_endpoints
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_disconnected_graph
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_group_betweenness_directed_weighted
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_greedy_algorithm
  /home/tkloczko/rpmbuild/BUILD/networkx-networkx-3.2.1/networkx/algorithms/centrality/group.py:501: FutureWarning: ChainedAssignmentError: behaviour will change in pandas 3.0!
  You are setting values through chained assignment. Currently this works in certain cases, but when using Copy-on-Write (which will become the default behaviour in pandas 3.0) this will never work to update the original DataFrame or Series, because the intermediate object on which we are setting values will behave as a copy.
  A typical example is when you are setting values in a column of a DataFrame, like:

  df["col"][row_indexer] = value

  Use `df.loc[row_indexer, "col"] = values` instead, to perform the assignment in a single step and ensure this keeps updating the original `df`.

  See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy

    DF_tree.nodes[node_p]["betweenness"][x][y] = (

networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_single_node
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_with_c
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_normalized_endpoints
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_disconnected_graph
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_group_betweenness_directed_weighted
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_greedy_algorithm
  /home/tkloczko/rpmbuild/BUILD/networkx-networkx-3.2.1/networkx/algorithms/centrality/group.py:505: FutureWarning: ChainedAssignmentError: behaviour will change in pandas 3.0!
  You are setting values through chained assignment. Currently this works in certain cases, but when using Copy-on-Write (which will become the default behaviour in pandas 3.0) this will never work to update the original DataFrame or Series, because the intermediate object on which we are setting values will behave as a copy.
  A typical example is when you are setting values in a column of a DataFrame, like:

  df["col"][row_indexer] = value

  Use `df.loc[row_indexer, "col"] = values` instead, to perform the assignment in a single step and ensure this keeps updating the original `df`.

  See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy

    DF_tree.nodes[node_p]["betweenness"][x][y] -= (

networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_single_node
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_with_c
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_normalized_endpoints
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_disconnected_graph
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_group_betweenness_directed_weighted
networkx/algorithms/centrality/tests/test_group.py::TestProminentGroup::test_prominent_group_greedy_algorithm
  /home/tkloczko/rpmbuild/BUILD/networkx-networkx-3.2.1/networkx/algorithms/centrality/group.py:509: FutureWarning: ChainedAssignmentError: behaviour will change in pandas 3.0!
  You are setting values through chained assignment. Currently this works in certain cases, but when using Copy-on-Write (which will become the default behaviour in pandas 3.0) this will never work to update the original DataFrame or Series, because the intermediate object on which we are setting values will behave as a copy.
  A typical example is when you are setting values in a column of a DataFrame, like:

  df["col"][row_indexer] = value

  Use `df.loc[row_indexer, "col"] = values` instead, to perform the assignment in a single step and ensure this keeps updating the original `df`.

  See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy

    DF_tree.nodes[node_p]["betweenness"][x][y] -= (

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
SKIPPED [1] networkx/algorithms/assortativity/tests/test_correlation.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/bipartite/tests/test_matrix.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/bipartite/tests/test_spectral_bipartivity.py:3: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality.py:8: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality_subset.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_current_flow_closeness.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_eigenvector_centrality.py:6: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_laplacian_centrality.py:6: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_second_order_centrality.py:8: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_subgraph.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_trophic.py:6: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/link_analysis/tests/test_hits.py:6: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/link_analysis/tests/test_pagerank.py:9: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_communicability.py:6: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_node_classification.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_polynomials.py:7: could not import 'sympy': No module named 'sympy'
SKIPPED [1] networkx/algorithms/tests/test_walks.py:8: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/classes/tests/test_backends.py:7: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/drawing/tests/test_agraph.py:7: could not import 'pygraphviz': No module named 'pygraphviz'
SKIPPED [1] networkx/drawing/tests/test_layout.py:7: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/drawing/tests/test_pydot.py:11: could not import 'pydot': No module named 'pydot'
SKIPPED [1] networkx/generators/tests/test_spectral_graph_forge.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_bethehessian.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_graphmatrix.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_laplacian.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_modularity.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_spectrum.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/tests/test_convert_scipy.py:4: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/approximation/tests/test_traveling_salesman.py:394: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/approximation/tests/test_traveling_salesman.py:431: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/approximation/tests/test_traveling_salesman.py:487: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/approximation/tests/test_traveling_salesman.py:522: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/approximation/tests/test_traveling_salesman.py:562: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/approximation/tests/test_traveling_salesman.py:601: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/approximation/tests/test_traveling_salesman.py:660: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/approximation/tests/test_traveling_salesman.py:715: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/approximation/tests/test_traveling_salesman.py:784: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/approximation/tests/test_traveling_salesman.py:832: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/approximation/tests/test_traveling_salesman.py:905: need --runslow option to run
SKIPPED [1] networkx/algorithms/bipartite/tests/test_basic.py:97: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/bipartite/tests/test_basic.py:108: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/bipartite/tests/test_basic.py:119: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/bipartite/tests/test_matching.py:223: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/bipartite/tests/test_matching.py:233: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/bipartite/tests/test_matching.py:245: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/bipartite/tests/test_matching.py:259: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/bipartite/tests/test_matching.py:276: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/bipartite/tests/test_matching.py:293: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/bipartite/tests/test_matching.py:310: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/bipartite/tests/test_matching.py:319: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:121: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:134: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:143: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:152: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:161: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:201: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:205: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:209: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:215: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:220: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:233: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:317: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:324: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/centrality/tests/test_katz_centrality.py:339: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/connectivity/tests/test_kcomponents.py:94: need --runslow option to run
SKIPPED [1] networkx/algorithms/connectivity/tests/test_kcomponents.py:110: need --runslow option to run
SKIPPED [1] networkx/algorithms/connectivity/tests/test_kcomponents.py:117: need --runslow option to run
SKIPPED [1] networkx/algorithms/connectivity/tests/test_kcutsets.py:136: need --runslow option to run
SKIPPED [1] networkx/algorithms/connectivity/tests/test_kcutsets.py:210: need --runslow option to run
SKIPPED [1] networkx/algorithms/flow/tests/test_gomory_hu.py:76: need --runslow option to run
SKIPPED [1] networkx/algorithms/flow/tests/test_maxflow_large_graph.py:128: need --runslow option to run
SKIPPED [1] networkx/algorithms/tests/test_cycles.py:873: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_cycles.py:887: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_cycles.py:898: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_cycles.py:919: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_distance_measures.py:337: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_distance_measures.py:366: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_distance_measures.py:372: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_distance_measures.py:377: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_distance_measures.py:384: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_distance_measures.py:399: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_distance_measures.py:403: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_distance_measures.py:416: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_distance_measures.py:429: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_distance_measures.py:547: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_distance_measures.py:553: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_distance_measures.py:559: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_distance_measures.py:571: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_distance_measures.py:592: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_distance_measures.py:597: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_distance_measures.py:625: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_distance_measures.py:650: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_distance_measures.py:673: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_distance_measures.py:682: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:44: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:60: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:86: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:101: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:116: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:153: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:190: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:197: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:238: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:252: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:281: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:310: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:339: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:363: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:372: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:383: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:394: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:405: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:417: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:432: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:445: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:457: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:471: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:489: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:501: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:513: could not import 'scipy': No module named 'scipy'
SKIPPED [2] networkx/algorithms/tests/test_similarity.py:531: could not import 'scipy': No module named 'scipy'
SKIPPED [2] networkx/algorithms/tests/test_similarity.py:609: could not import 'scipy': No module named 'scipy'
SKIPPED [2] networkx/algorithms/tests/test_similarity.py:637: could not import 'scipy': No module named 'scipy'
SKIPPED [2] networkx/algorithms/tests/test_similarity.py:674: could not import 'scipy': No module named 'scipy'
SKIPPED [2] networkx/algorithms/tests/test_similarity.py:697: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:702: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:732: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:776: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:790: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:796: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:809: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:822: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:860: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_similarity.py:901: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_threshold.py:251: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tests/test_tournament.py:127: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tree/tests/test_mst.py:464: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tree/tests/test_mst.py:492: need --runslow option to run
SKIPPED [1] networkx/algorithms/tree/tests/test_mst.py:588: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/algorithms/tree/tests/test_mst.py:618: need --runslow option to run
SKIPPED [5] networkx/generators/tests/test_expanders.py:25: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_algebraic_connectivity.py:15: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_algebraic_connectivity.py:23: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_algebraic_connectivity.py:31: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_algebraic_connectivity.py:39: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_algebraic_connectivity.py:50: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_algebraic_connectivity.py:105: could not import 'scipy': No module named 'scipy'
SKIPPED [4] networkx/linalg/tests/test_algebraic_connectivity.py:112: could not import 'scipy': No module named 'scipy'
SKIPPED [4] networkx/linalg/tests/test_algebraic_connectivity.py:124: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_algebraic_connectivity.py:137: could not import 'scipy': No module named 'scipy'
SKIPPED [4] networkx/linalg/tests/test_algebraic_connectivity.py:148: could not import 'scipy': No module named 'scipy'
SKIPPED [4] networkx/linalg/tests/test_algebraic_connectivity.py:159: could not import 'scipy': No module named 'scipy'
SKIPPED [4] networkx/linalg/tests/test_algebraic_connectivity.py:171: could not import 'scipy': No module named 'scipy'
SKIPPED [4] networkx/linalg/tests/test_algebraic_connectivity.py:182: could not import 'scipy': No module named 'scipy'
SKIPPED [8] networkx/linalg/tests/test_algebraic_connectivity.py:200: could not import 'scipy': No module named 'scipy'
SKIPPED [4] networkx/linalg/tests/test_algebraic_connectivity.py:333: could not import 'scipy': No module named 'scipy'
SKIPPED [4] networkx/linalg/tests/test_algebraic_connectivity.py:342: could not import 'scipy': No module named 'scipy'
SKIPPED [4] networkx/linalg/tests/test_algebraic_connectivity.py:351: could not import 'scipy': No module named 'scipy'
SKIPPED [4] networkx/linalg/tests/test_algebraic_connectivity.py:361: could not import 'scipy': No module named 'scipy'
SKIPPED [4] networkx/linalg/tests/test_algebraic_connectivity.py:371: could not import 'scipy': No module named 'scipy'
SKIPPED [8] networkx/linalg/tests/test_algebraic_connectivity.py:395: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_attrmatrix.py:80: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/linalg/tests/test_attrmatrix.py:94: could not import 'scipy': No module named 'scipy'
SKIPPED [1] networkx/tests/test_all_random_functions.py:222: need --runslow option to run
FAILED networkx/algorithms/components/tests/test_strongly_connected.py::TestStronglyConnected::test_connected_raise
FAILED networkx/algorithms/tests/test_distance_measures.py::TestResistanceDistance::test_resistance_distance
===== 2 failed, 4683 passed, 220 skipped, 20 warnings in 120.36s (0:02:00) =====
```
</details>

As you may see there are as well some pytest warnings.

Please let me know if you want above patch as PR.
I wasn't able to reproduce this error locally. I even tried changing matplotlib's version in `requirements/default.txt` to 3.8.3 but still, no tests were failing. Looking at the above logs(`test session starts` section) you are using `Python 3.9.18` but networkx requires `Python >=3.10`.
> I wasn't able to reproduce this error locally. I even tried changing matplotlib's version in `requirements/default.txt` to 3.8.3 but still, no tests were failing. Looking at the above logs(`test session starts` section) you are using `Python 3.9.18` but networkx requires `Python >=3.10`.

Are you sure? 🤔 
In tagged 3.2.1 version pyproject.toml I see:
https://github.com/networkx/networkx/blob/9c1ee6392311d056760714d4126cd6382f75a96f/pyproject.toml#L9
There are a few different things reported here, I'll try to address them separately:

Re: the original reported test failure, i.e. the fact that `matplotlib` has no `use` attr - I can't reproduce this one. Matplotlib 3.8.3 certainly does have this method:

```bash
python -m venv mpl-test
source mpl-test/bin/activate
python -m pip install matplotlib==3.8.3
python -c "import matplotlib as mpl; mpl.use('PS')"  # Works fine
```

However - in the test incantation, `pytest.importorskip` [is used](https://github.com/networkx/networkx/blob/76c3e9bc00fb7d159b00e4c71c7274d185fcb254/networkx/drawing/tests/test_pylab.py#L8) to load matplotlib. It's possible there's some bad interaction with the importorskip, then immediately calling a method on the bound `mpl` name - though I would expect that to raise some form of `ModuleNotFound` error rather than an `AttributeError`. Perhaps there's some sort of partial/malformed matplotlib package in the test environment?

---

The missing scipy imports are real - these snuck in because we only test two environments w.r.t default dependencies: when *none* of them are installed, or when *all* of them are installed. There is no explicit testing (IIRC) of a subset of default dependencies. Patches to fix the missing scipy importorskips welcome!

---

The remaining test failures that aren't covered above have been fixed already on `main` and will be incorporated in the next release (within the next couple weeks).
I'm not 100% but my understanding is that mainly all those issues are related only to test suite and no actual tested code.
Am I right? 🤔 

> I'm not 100% but my understanding is that mainly all those issues are related only to test suite and no actual tested code.

Correct - these are all warts on the test suite and should not affect user-facing code. It's possible that some of the scipy dependencies make it possible to have an environment where some NX functionality is not avaialbe, but that's expected and the resulting `ImportError`/`ModuleNotFoundError` should make it very clear to users which "soft" dependencies are missing.

Resolving patch:
diff --git a/networkx/conftest.py b/networkx/conftest.py
--- a/networkx/conftest.py
+++ b/networkx/conftest.py
@@ -241,25 +241,31 @@ def add_nx(doctest_namespace):
     "algorithms/centrality/current_flow_betweenness_subset.py",
     "algorithms/centrality/eigenvector.py",
     "algorithms/centrality/katz.py",
+    "algorithms/centrality/laplacian.py",
     "algorithms/centrality/second_order.py",
     "algorithms/centrality/subgraph_alg.py",
     "algorithms/communicability_alg.py",
+    "algorithms/community/divisive.py",
+    "algorithms/distance_measures.py",
     "algorithms/link_analysis/hits_alg.py",
     "algorithms/link_analysis/pagerank_alg.py",
     "algorithms/node_classification.py",
     "algorithms/similarity.py",
+    "algorithms/tree/mst.py",
+    "algorithms/walks.py",
     "convert_matrix.py",
     "drawing/layout.py",
+    "drawing/nx_pylab.py",
     "generators/spectral_graph_forge.py",
     "generators/expanders.py",
     "linalg/algebraicconnectivity.py",
     "linalg/attrmatrix.py",
     "linalg/bethehessianmatrix.py",
     "linalg/graphmatrix.py",
+    "linalg/laplacianmatrix.py",
     "linalg/modularitymatrix.py",
     "linalg/spectrum.py",
     "utils/rcm.py",
-    "algorithms/centrality/laplacian.py",
 ]
 needs_matplotlib = ["drawing/nx_pylab.py"]
 needs_pandas = ["convert_matrix.py"]


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -58,6 +58,30 @@ jobs:
         run: |
           pytest --doctest-modules --durations=10 --pyargs networkx
 
+  default-without-scipy:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+      - name: Set up Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: "3.12"
+
+      - name: Install packages
+        run: |
+          python -m pip install --upgrade pip
+          python -m pip install -r requirements/default.txt -r requirements/test.txt
+          python -m pip uninstall -y scipy  # All default dependencies except scipy
+          python -m pip install .
+          python -m pip list
+
+      - name: Test for warnings at import time
+        run: python -Werror -c "import networkx"
+
+      - name: Test NetworkX
+        run: |
+          pytest --doctest-modules --durations=10 --pyargs networkx
+
   dispatch:
     runs-on: ubuntu-latest
     strategy:
diff --git a/networkx/algorithms/community/tests/test_divisive.py b/networkx/algorithms/community/tests/test_divisive.py
--- a/networkx/algorithms/community/tests/test_divisive.py
+++ b/networkx/algorithms/community/tests/test_divisive.py
@@ -41,7 +41,7 @@ def test_edge_betweenness_partition():
 
 
 def test_edge_current_flow_betweenness_partition():
-    pytest.importorskip("numpy")
+    pytest.importorskip("scipy")
 
     G = nx.barbell_graph(3, 0)
     C = nx.community.edge_current_flow_betweenness_partition(G, 2)
diff --git a/networkx/algorithms/tests/test_cycles.py b/networkx/algorithms/tests/test_cycles.py
--- a/networkx/algorithms/tests/test_cycles.py
+++ b/networkx/algorithms/tests/test_cycles.py
@@ -11,10 +11,9 @@
 def check_independent(basis):
     if len(basis) == 0:
         return
-    try:
-        import numpy as np
-    except ImportError:
-        return
+
+    np = pytest.importorskip("numpy")
+    sp = pytest.importorskip("scipy")  # Required by incidence_matrix
 
     H = nx.Graph()
     for b in basis:
diff --git a/networkx/algorithms/tests/test_distance_measures.py b/networkx/algorithms/tests/test_distance_measures.py
--- a/networkx/algorithms/tests/test_distance_measures.py
+++ b/networkx/algorithms/tests/test_distance_measures.py
@@ -324,6 +324,7 @@ class TestResistanceDistance:
     def setup_class(cls):
         global np
         np = pytest.importorskip("numpy")
+        sp = pytest.importorskip("scipy")
 
     def setup_method(self):
         G = nx.Graph()
@@ -428,6 +429,7 @@ class TestEffectiveGraphResistance:
     def setup_class(cls):
         global np
         np = pytest.importorskip("numpy")
+        sp = pytest.importorskip("scipy")
 
     def setup_method(self):
         G = nx.Graph()
@@ -600,6 +602,7 @@ class TestKemenyConstant:
     def setup_class(cls):
         global np
         np = pytest.importorskip("numpy")
+        sp = pytest.importorskip("scipy")
 
     def setup_method(self):
         G = nx.Graph()
diff --git a/networkx/algorithms/tree/tests/test_mst.py b/networkx/algorithms/tree/tests/test_mst.py
--- a/networkx/algorithms/tree/tests/test_mst.py
+++ b/networkx/algorithms/tree/tests/test_mst.py
@@ -737,6 +737,7 @@ class TestNumberSpanningTrees:
     def setup_class(cls):
         global np
         np = pytest.importorskip("numpy")
+        sp = pytest.importorskip("scipy")
 
     def test_nst_disconnected(self):
         G = nx.empty_graph(2)
diff --git a/networkx/drawing/tests/test_pylab.py b/networkx/drawing/tests/test_pylab.py
--- a/networkx/drawing/tests/test_pylab.py
+++ b/networkx/drawing/tests/test_pylab.py
@@ -32,7 +32,8 @@ def test_draw():
         for function, option in itertools.product(functions, options):
             function(barbell, **option)
             plt.savefig("test.ps")
-
+    except ModuleNotFoundError:  # draw_kamada_kawai requires scipy
+        pass
     finally:
         try:
             os.unlink("test.ps")