Skip to content

Installation from source instructions in README #4140

Open

Description

@idoerg

Setup

I am reporting a problem with Biopython version, Python version, and operating
system as follows:

import sys; print(sys.version)
import platform; print(platform.python_implementation()); print(platform.platform())
import Bio; print(Bio.__version__)

3.8.10 (default, Jun 22 2022, 20:18:18) 
[GCC 9.4.0]
CPython
Linux-4.19.2-041902-generic-x86_64-with-glibc2.29
1.80.dev0

(Please copy and run the above in your Python, and copy-and-paste the output)

Expected behaviour

Copying from the README these three commands are supposed to install Biopython from source when run from the source installation root directory:

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

Actual behaviour

The above produces a series of import errors, and a warning that Bio is being imported from the source tree, after running the second command.

Steps to reproduce

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

Fix

Rather, to install from source this needs to be done from the source root directory:

python setup.py build
sudo python setup.py install
cd Tests
python run_tests.py [--offline]

Activity

  1. peterjc commented on Oct 21, 2022

    @peterjc
    Member

    One significant downside of your suggestion is it runs the tests after installing. At which point if something hasn't worked it is too late. You have to uninstall (and if this was an upgrade, try to reinstall the older working version). However I'm unclear if build/test/install is going to be possible long term if we want to migrate away from setup.py to the more modern declararitve setup.

    I would regard the warning about being imported from the source tree as a false positive in this specific use case, so perhaps we can silence that in run_tests.py? The warning was added in #2007 but has caused other false positives, e.g. #3653 (fixed).

    What are the other import errors to you see?

    Running locally after first completely uninstalling Biopython I am seeing multiple ModuleNotFoundError: No module named 'Bio.PDB.ccealign' messages, which puzzles me as sister C module Bio.PDB.kdtrees does not error and both are compiled and present in my build folder:

    $ ls build/lib.linux-x86_64-3.7/Bio/PDB/*.so
    build/lib.linux-x86_64-3.7/Bio/PDB/ccealign.cpython-37m-x86_64-linux-gnu.so
    build/lib.linux-x86_64-3.7/Bio/PDB/kdtrees.cpython-37m-x86_64-linux-gnu.so
    

    (And some knock-on PDB failures, plus some other non-import errors which puzzle me but seem to be a separate issue)

  2. peterjc commented on Oct 21, 2022

    @peterjc
    Member

    Ah, #3912 broke the classic build/test/install

    There is an open PR #3937 to update the docs.

  3. idoerg commented on Oct 21, 2022

    @idoerg
    ContributorAuthor
  4. peterjc commented on Oct 21, 2022

    @peterjc
    Member

    In light of #3912, build/test/install is not going to work (we'd now expect import errors from the C code). The installation from source docs need updating.

    i.e. That source tree warning is not a false positive (but it would have been prior to #3912).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions