[Biopython] Solved Ubuntu bionic packaging issue: python-biopython-sql factored out too aggressively?

Jan T Kim jttkim at googlemail.com
Thu Aug 23 14:27:52 UTC 2018


Hi All,

I ran into a problem when running a script that was working with
biopython 1.66 on Ubuntu xenial caused a problem with biopython 1.70
on Ubuntu bionic:

  [...]
  File "/usr/lib/python2.7/dist-packages/Bio/SeqRecord.py", line 440, in __getitem__
    from BioSQL.BioSeq import DBSeqRecord
ImportError: No module named BioSQL.BioSeq

The offending import line, with a bit of context is:

        elif isinstance(index, slice):
            if self.seq is None:
                raise ValueError("If the sequence is None, we cannot slice it.")
            parent_length = len(self)
            from BioSQL.BioSeq import DBSeqRecord
            if isinstance(self, DBSeqRecord):

The problem was solved by installing python-biopython-sql [1]. Looking at
the "from BioSQL.BioSeq import DBSeqRecord" makes me wonder, though,
whether the Debian / Ubuntu package dependencies should allow installing
python-biopython without installing python-biopython-sql at all, as it
appears that the slicing functionality of SeqRecord won't work reliably
without the SQL package. However, the Ubuntu page on python-bioppython [2]
doesn't mention the python-biopython-sql package at all (not even as a
suggestion).

While this issue is related to the Ubuntu bionic packaging, the root cause
of this dependency / tight coupling of python-biopython and python-biopython-sql
seems to be that import statement that's buried in a __getitem__ method, which
I'd consider a biopython design issue. It seems plausible to me that someone
building the python-biopython* packages could overlook this dependency, and
therefore jump to the conclusion that the -sql package can be factored out as
an optional package.

I also post this in the hope that others who run into this issue may find
this solution in the mailing list archives...

Best regards, Jan


[1] https://packages.ubuntu.com/bionic/python-biopython-sql
[2] https://packages.ubuntu.com/bionic/python-biopython



More information about the Biopython mailing list