wardbradt / peregrine

Detects arbitrage opportunities across 131 cryptocurrency exchanges in 50 countries
MIT License
1.18k stars 339 forks source link

AttributeError: 'MultiDiGraph' object has no attribute 'edge_bunches' #60

Closed ymovlian closed 3 years ago

ymovlian commented 4 years ago

Hello,

I'm trying to run Multiple Exchanges/ Multiple Currencies example from the README and get the following error:

$ python3 script.py 
Traceback (most recent call last):
  File "peregrine.py", line 6, in <module>
    for path in paths:
  File "/home/username/.local/lib/python3.7/site-packages/peregrinearb/bellman_multi_graph.py", line 20, in bellman_ford
    self._first_iteration()
  File "/home/username/.local/lib/python3.7/site-packages/peregrinearb/bellman_multi_graph.py", line 43, in _first_iteration
    [self._process_edge_bunch(edge_bunch) for edge_bunch in self.graph.edge_bunches(data=True)]
AttributeError: 'MultiDiGraph' object has no attribute 'edge_bunches'

I'm using dev branch.

wardbradt commented 4 years ago

You have to run pip install git+https://github.com/wardbradt/networkx. This is undocumented and is a problem with the requirements.txt file. I will fix it.

al3github commented 3 years ago

Hi, I am having the same problem as @packetlife and I have networkx (2.5) installed. When I went to check the MultiDiGraph code, I saw that indeed this class has no attribute 'edge_bunches'.

edouardkombo commented 3 years ago

@al3github This fix is addressed here https://github.com/wardbradt/peregrine/pull/76

@wardbradt could you please accept the pull request?