Tophat2 shows error during running
2
1
Entering edit mode
9.4 years ago
Whoknows ▴ 960

Hi friends

I installed Tophat2 with all dependencies (bowtie2, Boost, Samtools) but when I want to run tophat, it shows this error:

File "/home/tophat-2.0.14/bin/tophat", line 1003
    except getopt.error, msg:                       ^
SyntaxError: invalid syntax

My python version is 3.4 , how can I fix this problem?

Thanks

RNA-seq Python Tophat • 6.0k views
ADD COMMENT
1
Entering edit mode

What Devon said. Tophat is not Python 3 clean, so Python 2 is required.

ADD REPLY
0
Entering edit mode

Hi Whoknows, did Devon's suggestion work for you?

ADD REPLY
0
Entering edit mode

Yes, tophat has problem with python 2, I had to reinstall linux with python2

ADD REPLY
0
Entering edit mode

Please accept his answer if that's the case, so this question would be marked as solved by the system.

ADD REPLY
0
Entering edit mode

Yes it was because python 3 in changed to python 2

ADD REPLY
0
Entering edit mode

Click the green check mark you see on the left panel of his answer, near the number of votes.

ADD REPLY
3
Entering edit mode
9.4 years ago

Try installing python2.

ADD COMMENT
2
Entering edit mode
6.8 years ago
Rahul Sharma ▴ 660

Here is a quick solution without installing/re-installing different versions of python:

# Create a new environment for python 2.7
>conda create -n py2 python=2.7 anaconda
#To activate this environment, use:
> source activate py2

>conda install -c bioconda tophat

>tophat2 --help  ### should work now
#To deactivate this environment, use:
> source deactivate py2
ADD COMMENT
0
Entering edit mode

Use the formatting bar (especially the 101010 code button) to format your post please. I've done it for you this time. Thank you.

ADD REPLY

Login before adding your answer.

Traffic: 1815 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6