[Biopython] install from source: is this an issue?

Markus Piotrowski Markus.Piotrowski at ruhr-uni-bochum.de
Thu Oct 20 02:41:26 EDT 2022


This may be a naive question, since I'm not very familiar with 
installing from source, but does "build" compile the C extensions or is 
this something that happens during "install"? In the first case you 
would be missing the compiled C-extension, leading to the described 
import error.

Best
Markus

Am 20.10.2022 um 01:58 schrieb Iddo Friedberg:
> Hi,
>
> Thank you for your answer, Michiel.
>
> So I'm confused as to what I am doing wrong. I downloaded the zip , 
> unzipped, changed to the biopython-master directory, and ran
> python setup.py build
> (this seems to be concluding fine)
>
> python setup.py test
>
> And the first error line (of many) is:
> /home/idoerg/Downloads/biopython-master/Bio/__init__.py:138: BiopythonWarning: You may be importing Biopython from inside the source tree.
> This is bad practice and might lead to downstream issues. In particular, you might encounter ImportErrors due to missing compiled C extensions.
> We recommend that you try running your code from outside the source tree.
> If you are outside the source tree then you have a setup.py file in an unexpected directory: /home/idoerg/Downloads/biopython-master
> Thanks,
>
> Iddo
>
> --
> Sent from a machine that promotes typos
>
> On Wed, Oct 19, 2022, 17:15 Michiel de Hoon <mjldehoon at yahoo.com> wrote:
>
>     Hi Iddo,
>
>
>     > The first error "BiopythonWarning: You may be importing
>     Biopython from inside the source tree."
>     > Is that something I can ignore,
>
>     No; it is causing the import error.
>
>     Best,
>     -Michiel
>
>     On Thursday, October 20, 2022 at 01:43:28 AM GMT+9, Iddo Friedberg
>     <idoerg at gmail.com> wrote:
>
>
>     Hi,
>
>     I'm trying to install biopython from source, since release 1.79
>     does not work with the newest Swissprot FT records. Looking at the
>     source of SwissProt/__init__.py in github this issue seems to be
>     fixed and hopefully release 1.80 this will work again.
>
>     However, I am encountering the following problem when trying to test:
>
>
>     idoerg at IddoWS:~/soft/biopython$ python setup.py test
>     running test
>     Python version: 3.7.5 (default, Dec  9 2021, 17:04:37)
>     [GCC 8.4.0]
>     Operating system: posix linux
>     /home/idoerg/soft/biopython/Bio/__init__.py:146: BiopythonWarning:
>     You may be importing Biopython from inside the source tree. This
>     is bad practice and might lead to downstream issues. In
>     particular, you might encounter ImportErrors due to missing
>     compiled C extensions. We recommend that you try running your code
>     from outside the source tree. If you are outside the source tree
>     then you have a setup.py file in an unexpected directory:
>     /home/idoerg/soft/biopython
>       BiopythonWarning,
>     test_Ace ... ok
>     test_Affy ... ok
>     test_AlignIO ... loading tests failed:
>     Failed to import test module: test_AlignIO
>     Traceback (most recent call last):
>       File "/usr/lib/python3.7/unittest/loader.py", line 154, in
>     loadTestsFromName
>         module = __import__(module_name)
>       File "/home/idoerg/soft/biopython/Tests/test_AlignIO.py", line
>     11, in <module>
>         from Bio import AlignIO
>       File "/home/idoerg/soft/biopython/Bio/AlignIO/__init__.py", line
>     140, in <module>
>         from Bio.Align import MultipleSeqAlignment
>       File "/home/idoerg/soft/biopython/Bio/Align/__init__.py", line
>     34, in <module>
>         from Bio.Align import _aligners
>     ImportError: cannot import name '_aligners' from 'Bio.Align'
>     (/home/idoerg/soft/biopython/Bio/Align/__init__.py)
>
>     Previous iterations of the "_aligners" import error error in the
>     biopython github were attributed to conflicting python versions.
>     This may be the case here, but before I kill all my anaconda
>     stuff, I just wanted to make sure that I'm actually running the
>     test correctly.  The first error "BiopythonWarning: You may be
>     importing Biopython from inside the source tree."
>
>     Is that something I can ignore, or am I doing yet another thing wrong?
>
>     Thanks,
>
>     Iddo
>
>     -- 
>     Iddo Friedberg
>     http://iddo-friedberg.net/contact.html
>     ++++++++++[>+++>++++++>++++++++>++++++++++>+++++++++++<<<<<-]>>>>++++.>
>     ++++++..----.<<<<++++++++++++++++++++++++++++.-----------..>>>+.-----.
>     .>-.<<<<--.>>>++.>+++.<+++.----.-.<++++++++++++++++++.>+.>.<++.<<<+.>>
>     >>----.<--.>++++++.<<<<------------------------------------.
>     _______________________________________________
>     Biopython mailing list  - Biopython at biopython.org
>     https://mailman.open-bio.org/mailman/listinfo/biopython
>
>
> _______________________________________________
> Biopython mailing list  -Biopython at biopython.org
> https://mailman.open-bio.org/mailman/listinfo/biopython

-- 
_________________________________
Dr. Markus Piotrowski
Privatdozent/Akademischer Rat
Lehrstuhl für Molekulargenetik und Physiologie der Pflanzen
ND 3/49
Universitätsstr. 150
44801 Bochum

Tel. xx49-(0)234-3224290
Fax. xx49-(0)234-3214187

https://www.ruhr-uni-bochum.de/pflaphy/Seiten_dt/Piotrowski_d.html
http://homepage.ruhr-uni-bochum.de/Markus.Piotrowski/Index.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biopython/attachments/20221020/6de9ce75/attachment-0001.htm>


More information about the Biopython mailing list