nanoporetech / DTR-phage-pipeline

Mozilla Public License 2.0
16 stars 6 forks source link

Failed to install DTR-phage-pipeline #6

Open JiaLonghao1997 opened 4 years ago

JiaLonghao1997 commented 4 years ago

image

After run:

conda env create -f environment.yml
conda activate DTR-phage-pipeline
snakemake --use-conda -p -r -j 10

I got the error, -bash: /home1/jialh/tools/miniconda3/envs/DTR-phage-pipeline/bin/snakemake: /home1/jialh/tools/miniconda3/envs/DTR-phage-pipeline/bin/python3.8: bad interpreter: Invalid argument

jmeppley commented 4 years ago

I won't have time to check into this until later, but our pipeline was built and tested on python 3.7. Python 3.8 arrived in bioconda this month.

Try changing "python >= 3.7" to "python == 3.7" in environment.yml and rebuilding the env.

-John

On Tue, Sep 15, 2020, 4:24 AM Longhao Jia notifications@github.com wrote:

[image: image] https://user-images.githubusercontent.com/32414349/93204613-f8ccb680-f788-11ea-9a58-67a94c9c6d87.png

After run:

conda env create -f environment.yml conda activate DTR-phage-pipeline snakemake --use-conda -p -r -j 10

I got the error, -bash: /home1/jialh/tools/miniconda3/envs/DTR-phage-pipeline/bin/snakemake: /home1/jialh/tools/miniconda3/envs/DTR-phage-pipeline/bin/python3.8: bad interpreter: Invalid argument

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on Github https://github.com/nanoporetech/DTR-phage-pipeline/issues/6, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANDP3FVYJCE2LUOOH26G5LSF5FGDANCNFSM4RM7IKAQ .ok

jmeppley commented 4 years ago

I've looked into this a little more.

First, my suggestion above was not 100% correct. That will get you python 3.7.0. To get the latest python 3.7 the environment.yml file should look like this:

name: DTR-phage-pipeline
channels:
  - conda-forge
  - bioconda
dependencies:
  - python = 3.7.*
  - snakemake >= 5.14.0
  - matplotlib
  - click
  - pandas
  - requests

The double equals (==) gives you python 3.7.0. The latest right now is 3.7.8.

Second, I'm unable to reproduce this bug. The test workflow is running just fine for me under python 3.8. I think your conda installation didn't work correctly.

Try running just "snakemake -h" to confirm. I suspect you'll get the same error.

The "bash: ... bad interpreter ..." coming from snakemake means that BASH can't figure out how to run snakemake. Common causes are your python executable is corrupt or non-executable or the #! line that starts the snakemake script is corrupted.

Are you using Docker or other container service? The "bad interpreter: invalid argument" error seems to often be related to a corrupt docker filesystem.

JiaLonghao1997 commented 4 years ago

I've looked into this a little more.

First, my suggestion above was not 100% correct. That will get you python 3.7.0. To get the latest python 3.7 the environment.yml file should look like this:

name: DTR-phage-pipeline
channels:
  - conda-forge
  - bioconda
dependencies:
  - python = 3.7.*
  - snakemake >= 5.14.0
  - matplotlib
  - click
  - pandas
  - requests

The double equals (==) gives you python 3.7.0. The latest right now is 3.7.8.

Second, I'm unable to reproduce this bug. The test workflow is running just fine for me under python 3.8. I think your conda installation didn't work correctly.

Try running just "snakemake -h" to confirm. I suspect you'll get the same error.

The "bash: ... bad interpreter ..." coming from snakemake means that BASH can't figure out how to run snakemake. Common causes are you're python executable is corrupt or non-executable or the #! line that starts the snakemake script is corrupted.

Are you using Docker or other container service? The "bad interpreter: invalid argument" error seems to often be related to a corrupt docker filesystem.

Thank you! I will have a try.

JiaLonghao1997 commented 4 years ago

I don't use Docker or other container service. Environment.yml file look like this:

name: DTR-phage-pipeline
channels:
  - conda-forge
  - bioconda
dependencies:
  - python == 3.7.*
  - snakemake >= 5.14.0
  - matplotlib
  - click
  - pandas
  - requests

Then I,

conda remove -n DTR-phage-pipeline --all
conda env create -f environment.yml
snakemake -h     #I don't get the same error.
snakemake --use-conda -p -r -j 10

Everything at the begining is great. However, I got another errors. How do I control the version of the package? image

jmeppley commented 4 years ago

Snakemake is trying to build dedicated conda environments for some of the workflow steps. These are defined in the envs/*.yml files. You can adjust the version requirements in those.

What operating system are you using?