[Biopython] problem with Bio.Align _aligns.c

Michiel de Hoon mjldehoon at yahoo.com
Wed Jun 27 11:50:49 UTC 2018


 >>> from Bio import Seq
This should be>>> from Bio.Seq import Seq

    On Wednesday, June 27, 2018, 8:33:42 PM GMT+9, Francesco Gastaldello (Staff) <f.gastaldello at dundee.ac.uk> wrote:  
 
 #yiv2129460908 #yiv2129460908 -- P {margin-top:0;margin-bottom:0;}#yiv2129460908 Peter:

After the upgrade to Ubuntu 18.04, my VM blow up and I had to re-build it from scratch. I'm not saying that I've made it exactly like the one that used the previous version, so I might miss some dependencies. I do not use/contribute to Biopython on my local Wndows machine anymore (because some module gave problem when I was developing some tests).
Ben:I've followed your suggestion. Directly on terminal (not via PyCharm or other IDE) I've entered the virtual environment dedicated to biopython and build+installed it from the source code. I get this in the console:
--(biopython) gasta at gasta-VirtualBox:~/Documents/GitHub/biopython(master)$ python setup.py installrunning installrunning buildrunning build_pyrunning build_extrunning install_libcopying build/lib.linux-x86_64-2.7/Bio/GenBank/__init__.py -> /home/gasta/venv/biopython/lib/python2.7/site-packages/Bio/GenBankbyte-compiling /home/gasta/venv/biopython/lib/python2.7/site-packages/Bio/GenBank/__init__.py to __init__.pycrunning install_egg_inforunning egg_infowriting requirements to biopython.egg-info/requires.txtwriting biopython.egg-info/PKG-INFOwriting top-level names to biopython.egg-info/top_level.txtwriting dependency_links to biopython.egg-info/dependency_links.txtreading manifest file 'biopython.egg-info/SOURCES.txt'reading manifest template 'MANIFEST.in'warning: no previously-included files matching '*.pyo' found anywhere in distributionwarning: no previously-included files matching '*.py{}' found anywhere in distributionwarning: no previously-included files matching '*.py-e' found anywhere in distributionwriting manifest file 'biopython.egg-info/SOURCES.txt'removing '/home/gasta/venv/biopython/lib/python2.7/site-packages/biopython-1.72-py2.7.egg-info' (and everything under it)Copying biopython.egg-info to /home/gasta/venv/biopython/lib/python2.7/site-packages/biopython-1.72-py2.7.egg-inforunning install_scripts--If I run the python console from the source directory I'm not able to run the tests mentioned in the installation guidelines, but numpy is fine (linking toMichiel comment):
--(biopython) gasta at gasta-VirtualBox:~/Documents/GitHub/biopython(master)$ pythonPython 2.7.15rc1 (default, Apr 15 2018, 21:51:34) [GCC 7.3.0] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> from Bio import Seq>>> from Bio.Alphabet.IUPAC import unambiguous_dna>>> new_seq = Seq('GATCAGAAG', unambiguous_dna)Traceback (most recent call last):  File "<stdin>", line 1, in <module>TypeError: 'module' object is not callable>>> import numpy
>>> numpy.array([[1, 2], [3, 4]])array([[1, 2],       [3, 4]]) --
Same happen when I run the exact same test elsewhere but still inside the virtual environment
--(biopython) gasta at gasta-VirtualBox:~$ pythonPython 2.7.15rc1 (default, Apr 15 2018, 21:51:34) [GCC 7.3.0] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> import numpy>>> numpy.array([[1, 2], [3, 4]])array([[1, 2],       [3, 4]]) >>> from Bio import Seq>>> from Bio.Alphabet.IUPAC import unambiguous_dna>>> new_seq = Seq('GATCAGAAG', unambiguous_dna)Traceback (most recent call last):  File "<stdin>", line 1, in <module>TypeError: 'module' object is not callable--
Francesco

From: Michiel de Hoon <mjldehoon at yahoo.com>
Sent: 27 June 2018 04:11:05
To: Francesco Gastaldello (Staff); p.j.a.cock at googlemail.com; Fulton, Ben
Cc: biopython at mailman.open-bio.org
Subject: Re: [Biopython] problem with Bio.Align _aligns.c Francesco, in which directory are you running Python?I can replicate this error only if I try these commands in the biopython source directory. In that case, python imports from the current directory, not from the installed directory.Importing Bio.Cluster will also fail for the same reason.Numpy has the same problem; there they show an informative error message if somebody tries to import numpy from the source tree:
>>> from numpy import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "numpy/__init__.py", line 131, in <module>
    raise ImportError(msg)
ImportError: Error importing numpy: you should not try to import numpy from
        its source directory; please exit the numpy source tree, and relaunch
        your python interpreter from there.


-Michiel

On Wednesday, June 27, 2018, 6:38:02 AM GMT+9, Fulton, Ben <befulton at iu.edu> wrote:

#yiv2129460908 #yiv2129460908 --#yiv2129460908x_yiv8000510501 #yiv2129460908x_yiv8000510501 -- filtered #yiv2129460908x_yiv8000510501 {}#yiv2129460908 filtered #yiv2129460908x_yiv8000510501 {font-family:Calibri;}#yiv2129460908 #yiv2129460908x_yiv8000510501 #yiv2129460908x_yiv8000510501 p.yiv2129460908x_yiv8000510501MsoNormal, #yiv2129460908 #yiv2129460908x_yiv8000510501 li.yiv2129460908x_yiv8000510501MsoNormal, #yiv2129460908 #yiv2129460908x_yiv8000510501 div.yiv2129460908x_yiv8000510501MsoNormal {margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:sans-serif;}#yiv2129460908 #yiv2129460908x_yiv8000510501 a:x_link, #yiv2129460908 #yiv2129460908x_yiv8000510501 span.yiv2129460908x_yiv8000510501MsoHyperlink {color:blue;text-decoration:underline;}#yiv2129460908 #yiv2129460908x_yiv8000510501 a:x_visited, #yiv2129460908 #yiv2129460908x_yiv8000510501 span.yiv2129460908x_yiv8000510501MsoHyperlinkFollowed {color:purple;text-decoration:underline;}#yiv2129460908 #yiv2129460908x_yiv8000510501 p.yiv2129460908x_yiv8000510501msonormal0, #yiv2129460908 #yiv2129460908x_yiv8000510501 li.yiv2129460908x_yiv8000510501msonormal0, #yiv2129460908 #yiv2129460908x_yiv8000510501 div.yiv2129460908x_yiv8000510501msonormal0 {margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:sans-serif;}#yiv2129460908 #yiv2129460908x_yiv8000510501 span.yiv2129460908x_yiv8000510501EmailStyle20 {font-family:sans-serif;color:windowtext;}#yiv2129460908 #yiv2129460908x_yiv8000510501 .yiv2129460908x_yiv8000510501MsoChpDefault {font-size:10.0pt;}#yiv2129460908 filtered #yiv2129460908x_yiv8000510501 {margin:1.0in 1.0in 1.0in 1.0in;}#yiv2129460908 
Wouldn’t you have to run “python setup.py install” to get the libraries into the correct locations?

 

--

Ben Fulton

Research Technologies

Scientific Applications and Performance Tuning

Indiana University

E-Mail: befulton at iu.edu

 

From: Biopython <biopython-bounces+befulton=iu.edu at mailman.open-bio.org>On Behalf Of Francesco Gastaldello (Staff)
Sent: Tuesday, June 26, 2018 10:36 AM
To: p.j.a.cock at googlemail.com
Cc: biopython at mailman.open-bio.org
Subject: Re: [Biopython] problem with Bio.Align _aligns.c

 

I'm running the test via Pycharm and it is connected to my origin and upstream branches on GitHub.

 

I've done a quick test of the other modules that use C and I can confirm that the same problem is visible.

I've run some tests even on the master branch, which I consider to be stable environment.

 

Francesco 

From: Peter Cock <p.j.a.cock at googlemail.com>
Sent: 26 June 2018 15:29:39
To: Francesco Gastaldello (Staff)
Cc: biopython at mailman.open-bio.org
Subject: Re: [Biopython] problem with Bio.Align _aligns.c 

 

You must be running from Git, perhaps even the
provisional tag for Biopython 1.72?

The error is worryingly similar to what I am getting
with the automated wheels for Linux and macOS
under TravisCI - they seem to build fine, but when
running the tests, the compiled code can't be found.

This is holding up the Biopython 1.72 release, see also:
http://mailman.open-bio.org/pipermail/biopython/2018-June/016474.html

Do you see this with other C code as well, e.g.
Bio.Cluster, or cpairwise2, or KDTree?

Perhaps this is a problem with the current code in
GitHub, not just something strange with the multi-
wheel setup as I had been assuming?

Peter

On Tue, Jun 26, 2018 at 12:26 PM, Francesco Gastaldello (Staff)
<f.gastaldello at dundee.ac.uk> wrote:
> Hi all,
>
>
> I have a virtual environment with python 2.7.15rc1 and I get this error when
> I run some commands:
>
>
> ////
>
> Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34)
> [GCC 7.3.0] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> from Bio import SeqIO
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "Bio/SeqIO/__init__.py", line 375, in <module>
>     from Bio.Align import MultipleSeqAlignment
>   File "Bio/Align/__init__.py", line 22, in <module>
>     from Bio.Align import _aligners
> ImportError: cannot import name _aligners
>
> ////
>
>
> I've made sure to run "python setup.py build" before trying anything but
> that did not solve the problem.
>
> I'm on Ububtu 18.04 on a virtual machine.
>
>
> Thanks,
>
> Francesco
>
>
> The University of Dundee is a registered Scottish Charity, No: SC015096
>
> _______________________________________________
> Biopython mailing list  -  Biopython at mailman.open-bio.org
> http://mailman.open-bio.org/mailman/listinfo/biopython


The University of Dundee is a registered Scottish Charity, No: SC015096
_______________________________________________
Biopython mailing list  -  Biopython at mailman.open-bio.org
http://mailman.open-bio.org/mailman/listinfo/biopython
The University of Dundee is a registered Scottish Charity, No: SC015096  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biopython/attachments/20180627/91b40e48/attachment-0001.html>


More information about the Biopython mailing list