Troubleshooting¶
This page covers common issues encountered when installing, running, or developing with Bio Sea Pearl. Each section describes the symptom, cause, and resolution.
Installation issues¶
biosea: command not found¶
Cause: The package is not installed, or the install location is not in your PATH.
Resolution:
If you installed with --user, ensure ~/.local/bin is in your PATH:
ModuleNotFoundError: No module named 'bio_sea_pearl'¶
Cause: The package is not installed in the active Python environment, or you are using a different Python than expected.
Resolution:
If the package is not listed, install it. If you are in a virtual environment, make sure it is activated.
Perl-related failures¶
FileNotFoundError: [Errno 2] No such file or directory: 'perl'¶
Cause: Perl is not installed on the system.
Resolution: Install Perl:
Info
Perl is required for alignment and Markov commands. Sequence tools (hamming, levenshtein, k-mer) and BWT commands work without Perl.
Can't locate MarkovChainHigherOrder.pm in @INC¶
Cause: The Perl module search path does not include markov/lib/.
Resolution: The wrapper sets PERL5LIB automatically based on the repository root. Verify that BIOSEA_REPO_ROOT is set correctly:
If running outside Docker or a standard install, set it explicitly:
Can't locate Inline.pm or Inline C compilation failed¶
Cause: The Perl Inline::C module is not installed, or no C compiler is available. This affects hamming.pm and levenshtein.pm in the Perl SeqTools.
Resolution: This only matters if you are using the Perl fallback path. The Python implementations (seqtools_py) do not require a C compiler. If the Python port is available, the system bypasses Perl automatically.
If you need the Perl path:
Alignment issues¶
align.py not found or alignment returns empty output¶
Cause: The wrapper cannot locate alignment/bin/align.py relative to the repository root.
Resolution:
-
Check that
BIOSEA_REPO_ROOTpoints to the correct directory: -
If running from a pip-installed wheel (not a local clone), ensure the wheel was built with
force-includeentries intact. Thealignment/directory should be bundled.
Matrix file not found¶
Cause: The specified scoring matrix path does not exist.
Resolution: Scoring matrices are in alignment/scoring/. Use the full relative path:
If no matrix is specified, the alignment script uses its built-in default. The wrapper falls back to blosum62.mat in the scoring directory.
REST API issues¶
Connection refused on localhost:8000¶
Cause: The API server is not running.
Resolution:
Or via Docker:
500 Internal Server Error from /align or /markov¶
Cause: Usually a Perl subprocess failure. The error detail will include the stderr from the Perl script.
Resolution:
- Check the response body for the
detailfield — it contains the error message. - Verify Perl is installed and
BIOSEA_REPO_ROOTis set (especially in Docker). -
Test the Perl script directly:
400 Bad Request from /distance¶
Cause: Validation error — for example, requesting Hamming distance on strings of different lengths.
Resolution: Check the detail field in the response. For Hamming distance, both sequences must be the same length. Use levenshtein for different-length strings.
Docker issues¶
Container starts but API returns errors¶
Cause: The BIOSEA_REPO_ROOT environment variable may not match the actual file layout in the container.
Resolution: The default docker-compose.yml sets BIOSEA_REPO_ROOT=/app. Verify:
docker exec biosea ls /app/alignment/bin/align.py
docker exec biosea ls /app/markov/bin/randomwalk.pl
Port conflict on 8000¶
Cause: Another service is using port 8000.
Resolution: Change the port mapping in docker-compose.yml:
Test failures¶
Tests skip with Perl not found¶
Cause: Expected behaviour. Tests that require Perl are decorated with @pytest.mark.skipif(shutil.which("perl") is None, ...) and are skipped when Perl is not installed.
Resolution: Install Perl to run the full test suite. The BWT and seqtools Python tests run without Perl.
ImportError in tests¶
Cause: The package is not installed in the test environment.
Resolution:
The pyproject.toml sets pythonpath = ["src", "."] for pytest, so tests should find the package when installed in editable mode.
Common environment variables¶
| Variable | Purpose | Default |
|---|---|---|
BIOSEA_REPO_ROOT |
Root directory for locating scripts and scoring matrices | Auto-detected from wrapper file location |
PERL5LIB |
Perl module search path (set by wrappers internally) | Not required for user configuration |
Getting help¶
- GitHub Issues: github.com/bibymaths/bio-sea-pearl/issues
- Source code: github.com/bibymaths/bio-sea-pearl
Related pages¶
- Installation — setup instructions
- Architecture — understanding the wrapper layer and dispatch
- Extending the Toolkit — developer workflow