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

Syntax error #1

Closed
spenagon opened this issue Aug 6, 2015 · 4 comments
Closed

Syntax error #1

spenagon opened this issue Aug 6, 2015 · 4 comments

Comments

@spenagon
Copy link

spenagon commented Aug 6, 2015

How can I solve this error?

File "orthofinder.py", line 229
with open(clustersFilename, 'rb') as clusterFile, open(newFilename, "wb") as output:
^
SyntaxError: invalid syntax

@davidemms
Copy link
Owner

Are you using an old version of python? If you're having problems with the 'with' statement it might be that that's the problem (https://www.python.org/dev/peps/pep-0343/). If so then it's best to install and use version 2.7.

Date: Thu, 6 Aug 2015 02:24:56 -0700
From: notifications@github.com
To: OrthoFinder@noreply.github.com
Subject: [OrthoFinder] Syntax error (#1)

How can I solve this error?

File "orthofinder.py", line 229

with open(clustersFilename, 'rb') as clusterFile, open(newFilename, "wb") as output:

                                                ^

SyntaxError: invalid syntax


Reply to this email directly or view it on GitHub.

@spenagon
Copy link
Author

spenagon commented Aug 6, 2015

I am using python version 2.6.5. When I change lines of with I get another error:
File "orthofinder.py", line 1031
fastaFileIndices = {filename:iSpecies for iSpecies, filename in enumerate(originalFastaFilenames_justNames)}
^
SyntaxError: invalid syntax

@davidemms
Copy link
Owner

Hi spenagon

I've just checked and the dictionary comprehension (the syntax you've posted) was introduced in versions 2.7, released 2010. I will put a note in the README file to tell users that they'll need to use version 2.7 but will download some older versions of python and see if I can make the code backwards compatible with these.

David

@davidemms
Copy link
Owner

Closing this issue now that README now makes clear the python version requirements.

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

2 participants