liguowang / cpat

Coding-Potential Assessment Tool using an alignment-free logistic regression model
Other
10 stars 4 forks source link

TypeError: unsupported operand type(s) for >>: 'builtin_function_or_method' and '_io.TextIOWrapper' #2

Open aa9gj opened 4 years ago

aa9gj commented 4 years ago

Hi,

I have been getting this error while running cpat on command line

Traceback (most recent call last): File "/scratch/aa9gj/bin/CPAT/CPAT-2.0.0/bin/cpat.py", line 241, in main() File "/scratch/aa9gj/bin/CPAT/CPAT-2.0.0/bin/cpat.py", line 229, in main print >>sys.stderr, "Input gene file is in FASTA format" TypeError: unsupported operand type(s) for >>: 'builtin_function_or_method' and '_io.TextIOWrapper'. Did you mean "print(, file=)"?

I have run the same FASTA file on the web server and it worked. Here is part of my fasta file Screen Shot 2019-12-12 at 9 39 44 AM

EDIT: I installed version 1.4.2 and using the same files and it worked. For this version I used python 2, and for version 2.0.0 I used python 3.

Thank you in advance for your time

Best, Arby

emaleckova commented 4 years ago

I am getting the same, also with Python 3.

davidbio commented 4 years ago

Same here, I don't understand how this is supposed to work.

bastien8060 commented 3 years ago

It means your code called something like: print >> sys.stderr, expression Instead of writing print >> sys.stderr, expression, it's instead necessary to write print(expression, file=sys.stderr).

It is a breaking change from Python 2.X to Python 3.X

More info here: https://stackoverflow.com/questions/36859424/unsupported-operand-types-for-builtin-function-or-method-and-io-textio