jcrozum / pystablemotifs

Python library for attractor identification and control in Boolean networks
MIT License
28 stars 7 forks source link

AttributeError: module 'numpy' has no attribute 'float64' #68

Closed alekhyaa2 closed 3 years ago

alekhyaa2 commented 3 years ago

Hi, I used pip install git+https://github.com/jcrozum/PyStableMotifs to install the package. Installation was successful with all the requirements fulfilled. When I try to import PyStableMotifs in jupyter notebook, I keep getting the following attribute error.

AttributeError Traceback (most recent call last)

in 1 #import PyStableMotifs as sm 2 #import PyBoolNet ----> 3 import PyStableMotifs C:\Anaconda\lib\site-packages\PyStableMotifs\__init__.py in 1 2 try: ----> 3 import PyBoolNet 4 except ImportError as e: 5 print(e) C:\Anaconda\lib\site-packages\PyBoolNet\__init__.py in 4 from __future__ import print_function 5 ----> 6 import PyBoolNet.Attractors 7 import PyBoolNet.Basins 8 import PyBoolNet.Commitment C:\Anaconda\lib\site-packages\PyBoolNet\Attractors.py in 7 import random 8 ----> 9 import PyBoolNet.FileExchange 10 import PyBoolNet.PrimeImplicants 11 import PyBoolNet.StateTransitionGraphs C:\Anaconda\lib\site-packages\PyBoolNet\FileExchange.py in 7 import datetime 8 ----> 9 import PyBoolNet.PrimeImplicants 10 import PyBoolNet.InteractionGraphs 11 import PyBoolNet.QuineMcCluskey C:\Anaconda\lib\site-packages\PyBoolNet\PrimeImplicants.py in 3 import PyBoolNet.FileExchange 4 import PyBoolNet.QuineMcCluskey ----> 5 import PyBoolNet.InteractionGraphs 6 import PyBoolNet.Utility.DiGraphs 7 import PyBoolNet.Utility.Misc C:\Anaconda\lib\site-packages\PyBoolNet\InteractionGraphs.py in 5 import math 6 import os ----> 7 import networkx 8 9 import PyBoolNet.StateTransitionGraphs C:\Anaconda\lib\site-packages\networkx\__init__.py in 113 from networkx.generators import * 114 --> 115 import networkx.readwrite 116 from networkx.readwrite import * 117 C:\Anaconda\lib\site-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 * C:\Anaconda\lib\site-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" C:\Anaconda\lib\site-packages\networkx\readwrite\graphml.py in GraphML() 342 else: 343 # prepend so that python types are created upon read (last entry wins) --> 344 types = [(np.float64, "float"), (np.float32, "float"), 345 (np.float16, "float"), (np.float_, "float"), 346 (np.int, "int"), (np.int8, "int"), AttributeError: module 'numpy' has no attribute 'float64' Could you please help me fix this? Thank you!
jcrozum commented 3 years ago

This looks like a networkx error related to some sort of incompatibility between networkx and numpy. I suggest updating netwokx and numpy:

pip install --upgrade numpy, networkx

Let me know if that fixes the problem for you.

alekhyaa2 commented 3 years ago

Yes, this did work. I had to upgrade matplotlib similarly. Thanks for the help!

jcrozum commented 3 years ago

Great, glad it worked!