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

Michiel de Hoon mjldehoon at yahoo.com
Wed Oct 19 23:32:08 EDT 2022


 Usually I go to biopython/Tests, and run "python run_tests.py --offline" from there.But you're right, "python setup.py test" should not run at all if it is not supposed to work.The docstring in setup.py says
    """Run all of the tests for the package.

    This is a automatic test run class to make distutils kind of act like
    perl. With this you can do:

    python setup.py build
    python setup.py install
    python setup.py test

    """

which is clearly wrong.
Perhaps we should change our file layout in the biopython distribution, and have all code under a src subdirectory or something
Best,-Michiel



    On Thursday, October 20, 2022 at 08:58:36 AM GMT+9, Iddo Friedberg <idoerg at gmail.com> wrote:  
 
 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-masterThanks,
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 Friedberghttp://iddo-friedberg.net/contact.html
++++++++++[>+++>++++++>++++++++>++++++++++>+++++++++++<<<<<-]>>>>++++.>
++++++..----.<<<<++++++++++++++++++++++++++++.-----------..>>>+.-----.
.>-.<<<<--.>>>++.>+++.<+++.----.-.<++++++++++++++++++.>+.>.<++.<<<+.>>
>>----.<--.>++++++.<<<<------------------------------------.
_______________________________________________
Biopython mailing list  -  Biopython at biopython.org
https://mailman.open-bio.org/mailman/listinfo/biopython
  
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biopython/attachments/20221020/48172cb0/attachment.htm>


More information about the Biopython mailing list