-
Bug reportNextflow does not appear to be able to find the correct Python3 in my HPC environment. I first discovered this when trying to run a Python script in my workflow using a shebang in the script I get the error:
Upon looking further into this I was able to determine that Nextflow only seems to be able to find Python version 2.7 (which is not even installed in my HPC environment). This doesn't appear to be a PATH issue as searching for python3 with Steps to reproduce this errorI've made a simple nf script to test this issue:
Where test_python.py is:
This outputs the following error:
Alternatively, if I change the shebang in test_python.py to
When testing to find python3 I get the following error:
However if I check each of these locations on the PATH I can find python3 in both Compared to if I use
Further confusing to me is that if within the nf script I use Environment
Additional contextI am using a HPC environment so I don't have full sudo permissions, and for that reason Nextflow is installed in a folder I have permissions to work with opposed to the HPC core bin directory. Also worth noting that I can run this script fine from the commandline with python3, so I believe this is a Nextflow error |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 1 reply
-
Which executor are you using? If the jobs are running on a different node than where you launch Nextflow, they might have a different environment and not have access to all of the commands you can access from the submitter node. I would try to run |
Beta Was this translation helpful? Give feedback.
-
I'm using slurm. Currently I'm using a srun job to test the workflow, but for the full pipeline I would use sbatch to submit a shell script with the nextflow command. From the commandline if I run
|
Beta Was this translation helpful? Give feedback.
-
I would look at the |
Beta Was this translation helpful? Give feedback.
-
Submitting
Looking through For reference this is the chunk I'm referring to:
|
Beta Was this translation helpful? Give feedback.
-
are you sure this is not a version of python that exists inside of your container |
Beta Was this translation helpful? Give feedback.
-
Bare in mind that the environment in the batch job can be different from the one you can access with the interactive shell. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your help with sorting this out, I thought I had exhausted all troubleshooting options but clearly not |
Beta Was this translation helpful? Give feedback.
-
this is excellent advice. Additionally, some more things I find that I need to always remember;
basically, you gotta do sanity-checking of your entire environment from top to bottom, and especially inside the context of which your job is running. Most all errors tend to get identified this way, eventually. |
Beta Was this translation helpful? Give feedback.
are you sure this is not a version of python that exists inside of your container
/projectDir/cellranger_bcl2fastq_singularity_container_latest.sif
?