Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import pyupset as pyu #13

Open
koustubhavachat opened this issue Apr 28, 2017 · 5 comments
Open

import pyupset as pyu #13

koustubhavachat opened this issue Apr 28, 2017 · 5 comments

Comments

@koustubhavachat
Copy link

Getting SyntaxError: invalid syntax on import pyupset as pyu

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

@radlinsky
Copy link

Hello, I am seeing this same error...
screen shot 2017-06-20 at 11 40 22 am

@samuelmiver
Copy link

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

@davidemms
Copy link

Hi

I get the same error. Is there any fix or workaround?

Thanks!
David

@popher
Copy link

popher commented Oct 29, 2017

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.

@dhmay
Copy link

dhmay commented Mar 2, 2018

The fix above works in Python 2.7, with two changes:

  1. The last argument should be "*args", not "*"
  2. there's more than one function in visualization.py that needs to change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants