networkx / nx-guides

Examples and Jupyter Notebooks about NetworkX
https://networkx.org/nx-guides/
Creative Commons Zero v1.0 Universal
192 stars 104 forks source link

Numpy deprecation function numpy.int #130

Open ajzabaleta opened 6 months ago

ajzabaleta commented 6 months ago

Hi there, I'm getting this error message when I try to use NetworkX:

/usr/local/lib/python3.10/dist-packages/networkx/init.py in 113 from networkx.generators import 114 --> 115 import networkx.readwrite 116 from networkx.readwrite import 117

/usr/local/lib/python3.10/dist-packages/networkx/readwrite/init.py in 13 from networkx.readwrite.nx_yaml import 14 from networkx.readwrite.gml import ---> 15 from networkx.readwrite.graphml import 16 from networkx.readwrite.gexf import 17 from networkx.readwrite.nx_shp import *

/usr/local/lib/python3.10/dist-packages/networkx/readwrite/graphml.py in 312 313 --> 314 class GraphML(object): 315 NS_GRAPHML = "http://graphml.graphdrawing.org/xmlns" 316 NS_XSI = "http://www.w3.org/2001/XMLSchema-instance"

/usr/local/lib/python3.10/dist-packages/networkx/readwrite/graphml.py in GraphML() 344 types = [(np.float64, "float"), (np.float32, "float"), 345 (np.float16, "float"), (np.float_, "float"), --> 346 (np.int, "int"), (np.int8, "int"), 347 (np.int16, "int"), (np.int32, "int"), 348 (np.int64, "int"), (np.uint8, "int"),

/usr/local/lib/python3.10/dist-packages/numpy/init.py in getattr(attr) 317 318 if attr in former_attrs: --> 319 raise AttributeError(former_attrs[attr]) 320 321 if attr == 'testing': AttributeError: module 'numpy' has no attribute 'int'.

Its seems that the class function is using (or including) "np.int", which has been deprecated.

I tried to downgrade Numpy, but other libraries show conflicts with earlier Numpy versions.

Can anyone help me to fix it? please.

rossbar commented 6 months ago

Which version of NetworkX are you using? IIRC this has been fixed for some time - instead of downgrading numpy, try upgrading NetworkX!