<div dir="ltr"><div>Debian-based distros (ie Debian, Ubuntu or Mint) have clustalW 2.1 in their repositories, but it is called just clustalw. So your code should be<br><br>cline = ClustalwCommandline(&quot;clustalw2&quot;, infile=&quot;test.fasta&quot;)<br>
<br></div>You said your code generates a file. What is that file?<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-08-29 8:28 GMT+09:00 Peter Cock <span dir="ltr">&lt;<a href="mailto:p.j.a.cock@googlemail.com" target="_blank">p.j.a.cock@googlemail.com</a>&gt;</span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Fri, Aug 29, 2014 at 8:06 AM, Jakub Stanislaw Nowak<br>
&lt;<a href="mailto:jakub.nowak@ed.ac.uk">jakub.nowak@ed.ac.uk</a>&gt; wrote:<br>
&gt; Hello,<br>
&gt;<br>
&gt; I am trying to run alignment using ClustalW in python.<br>
&gt;<br>
&gt; I have used this code to compile<br>
&gt;<br>
&gt; cline = ClustalwCommandline(&quot;clustalw2&quot;, infile=&quot;test.fasta&quot;)<br>
&gt; print(cline)<br>
&gt; stdout, stderr = cline()<br>
&gt; align = AlignIO.read(&quot;test.aln&quot;, &quot;clustal&quot;)<br>
&gt; print(align)<br>
&gt;<br>
&gt;<br>
&gt; But it is generating file. I think I have some problem with setting a proper<br>
&gt; pathway to  clustal.<br>
&gt;<br>
&gt;<br>
&gt; This is the error:<br>
&gt;<br>
&gt; clustalw2 -infile=test.fasta<br>
&gt; Traceback (most recent call last):<br>
&gt;   File &quot;/Users/user/Google Drive/Bioinformatics/smallRNAseq/Python U<br>
&gt; densities/trial4old.py&quot;, line 95, in &lt;module&gt;<br>
&gt;     stdout, stderr = cline()<br>
&gt;   File<br>
&gt; &quot;/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/Bio/Application/__init__.py&quot;,<br>
&gt; line 513, in __call__<br>
&gt;     stdout_str, stderr_str)<br>
&gt; Bio.Application.ApplicationError: Non-zero return code 127 from &#39;clustalw2<br>
&gt; -infile=test.fasta&#39;, message &#39;/bin/sh: clustalw2: command not found&#39;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Can you suggest some solution?<br>
<br>
</div></div>What happens at the command line (outside Python)<br>
if you run these command?<br>
<br>
$ clustalw2 -infile=test.fasta<br>
<br>
$ which clustalw2<br>
<br>
If that fails, it means clustalw2 is not installed on your $PATH.<br>
How was clustalw2 installed?<br>
<br>
If you have clustalw2 somewhere like this:<br>
/Users/jakub/downloads/clustalw2.1/bin/clustalw2<br>
<br>
Then the command would become:<br>
<br>
/Users/jakub/downloads/clustalw2.1/bin/clustalw2 -infile=test.fasta<br>
<br>
The Python code would become:<br>
<br>
cline = ClustalwCommandline(&quot;/Users/jakub/downloads/clustalw2.1/bin/clustalw2&quot;,<br>
infile=&quot;test.fasta&quot;)<br>
<br>
Regards,<br>
<br>
Peter<br>
_______________________________________________<br>
Biopython mailing list  -  <a href="mailto:Biopython@mailman.open-bio.org">Biopython@mailman.open-bio.org</a><br>
<a href="http://mailman.open-bio.org/mailman/listinfo/biopython" target="_blank">http://mailman.open-bio.org/mailman/listinfo/biopython</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><font face="arial,helvetica,sans-serif">Alexey Morozov,<br>LIN SB RAS, bioinformatics group.<br>Irkutsk, Russia.<br></font>
</div>