Skip to content

python: command not found error when calling runfile #271

@vncntprvst

Description

@vncntprvst

I don't understand why but I have an issue where the python call in the runfile fails.
The make_runfile function creates a runfile like this:

#!/bin/bash
export CONDA_PREFIX=/home/wanglab/mambaforge/envs/mescore
export CONDA_PYTHON_EXE=/home/wanglab/mambaforge/bin/python
export CONDA_PREFIX_1=/home/wanglab/mambaforge
export OPENBLAS_NUM_THREADS=1
export MKL_NUM_THREADS=1
python /home/wanglab/mambaforge/envs/mescore/lib/python3.10/site-packages/mesmerize_core/algorithms/mcorr.py --batch-path /home/wanglab/data/2P/run1/mesmerize/batch_20240206-180343.pickle --uuid 2b980e81-1875-4059-8506-9c7dda88e076 --data-path /home/wanglab/data/2P/run1/mesmerize

When it's executed, it fails like this:

Running batch item 0, id 2b980e81-1875-4059-8506-9c7dda88e076, algo mcorr.
/home/wanglab/data/2P/run1/mesmerize/2b980e81-1875-4059-8506-9c7dda88e076.runfile: line 7: python: command not found

It's as if python is not found in the path.

I fixed that issue by updating the code here

            if "CONDA_PREFIX" in os.environ.keys():
                f.write(f"$CONDA_PREFIX/bin/python {module_path} {args_str}")
            else:
                f.write(f"python {module_path} {args_str}")  # call the script to run

The environment is up to date with mesmerize.

mesmerize-core            0.3.0              pyhd8ed1ab_0    conda-forge
python                    3.10.9          he550d4f_0_cpython    conda-forge

Wondering if you've ever seen that issue ?
Would you be open to include that fix, if we can't pinpoint the reason for this bug?

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