Closed Danyc0 closed 2 years ago
After a bit of digging, it looks like I was pulling down tabulate v0.9.0, which may be the cause of the issue, but if I downgrade to tabulate v0.8.7 as required by requirements.txt, we then get a new error, which seems to root in tabulates use of the Iterable abstract class, which was deprecated in python 3.10. The new error is as follows:
Traceback (most recent call last):
File "/home/dan/test/main.py", line 1, in <module>
import pyrankvote
File "/home/dan/test/env/lib/python3.10/site-packages/pyrankvote/__init__.py", line 2, in <module>
from pyrankvote.single_seat_ranking_methods import instant_runoff_voting
File "/home/dan/test/env/lib/python3.10/site-packages/pyrankvote/single_seat_ranking_methods.py", line 8, in <module>
from pyrankvote.helpers import CompareMethodIfEqual, ElectionResults
File "/home/dan/test/env/lib/python3.10/site-packages/pyrankvote/helpers.py", line 10, in <module>
from tabulate import tabulate
File "/home/dan/test/env/lib/python3.10/site-packages/tabulate.py", line 16, in <module>
from collections import Iterable
ImportError: cannot import name 'Iterable' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
which looks like it's caused by a silly version comparison which doesn't work with python v3.10, which is fixed in tabulate v0.9.0, and if I fix it in v0.8.7, pyrankvote bursts back into life
Thanks for your report. I will take a look at it tomorrow.
I have know fixed the issue in newly released version 2.0.6 that has been published on PyPi/pip today.
I'm using pyrankvote v2.0.5 straight from pip, and I've just updated to python v3.10.7 but now my previously working projects using the library no longer work. My first test was to try to run the example code in the README, and that errored in the same way as my code, as follows:
Thanks, Dan