Open koustubhavachat opened 7 years ago
Hello, I am seeing this same error...
Same error here:
File "/usr/local/lib/python2.7/dist-packages/pyupset/visualisation.py", line 12
def plot(data_dict, *, unique_keys=None, sort_by='size', inters_size_bounds=(0, np.inf),
^
SyntaxError: invalid syntax
Hi
I get the same error. Is there any fix or workaround?
Thanks! David
Looks like it's a Python 2 issue related to having *args in the function before the remaining default arguments.
Two solutions:
1) Use python3.
2) Edit visualisation.py to fix this (move the to the end of the function brackets, and check that that doesn't break anything else).
i.e. change:
`def plot(data_dict, , unique_keys=None, sort_by='size', inters_size_bounds=(0, np.inf),
inters_degree_bounds=(1, np.inf), additional_plots=None, query=None): to
def plot(data_dict, unique_keys=None, sort_by='size', inters_size_bounds=(0, np.inf),
inters_degree_bounds=(1, np.inf), additional_plots=None, query=None, *):`
I don't use python 2 so I can't test it readily.
The fix above works in Python 2.7, with two changes:
Traceback (most recent call last): File "C:\MyWork\upset\upsetxmplgithub.py", line 1, in <module> import pyupset as pyu File "C:\Python27\lib\site-packages\pyupset\__init__.py", line 2, in <module> from .visualisation import plot File "C:\Python27\lib\site-packages\pyupset\visualisation.py", line 12 def plot(data_dict,*, unique_keys=None, sort_by='size', inters_size_bounds=(0, np.inf), ^ SyntaxError: invalid syntax