Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python: command not found error when calling runfile #271

Open
vncntprvst opened this issue Feb 6, 2024 · 1 comment
Open

python: command not found error when calling runfile #271

vncntprvst opened this issue Feb 6, 2024 · 1 comment

Comments

@vncntprvst
Copy link

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?

@kushalkolar
Copy link
Collaborator

I'm not sure why it's failing for you without the full path to the env python. I currently don't have the bandwidth to dig into this and test whether this breaks existing functionality. CI is currently broken because caiman made some weird changes a few months ago that broke things 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants