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

Error in rule create_cov_bed: ModuleNotFoundError: No module named 'pyd4' #144

Closed
Erythroxylum opened this issue Dec 13, 2023 · 14 comments
Closed

Comments

@Erythroxylum
Copy link

Erythroxylum commented Dec 13, 2023

Hello, I just set up snakemake and executed the ecoli test command within a login node and then again with the test partition on the FASRC server. The error is:

Traceback (most recent call last):
File "/n/holyscratch01/davis_lab/dwhite/snpArcher/.test/ecoli/.snakemake/scripts/tmpb53k8wei.create_coverage_bed.py", line 5, in
from pyd4 import D4File,D4Builder
ModuleNotFoundError: No module named 'pyd4'
[Wed Dec 13 10:30:55 2023]
Error in rule create_cov_bed:
jobid: 14
input: results/GCA_000008865.2/summary_stats/all_cov_sumstats.txt, results/GCA_000008865.2/callable_sites/all_samples.d4
output: results/GCA_000008865.2/callable_sites/ecoli_test_callable_sites_cov.bed
conda-env: /n/holyscratch01/davis_lab/dwhite/snpArcher/.test/ecoli/.snakemake/conda/e6e860e6c3364a4f25a50109432a6090_

Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Complete log: .snakemake/log/2023-12-13T091938.314670.snakemake.log

-The .snakemake directory to get the complete log does not exist. Please let me know if there are any logs you would like to see. Thanks for your attention.

@cademirch
Copy link
Collaborator

What was your snakemake command? Did you include --use-conda?

@Erythroxylum
Copy link
Author

Erythroxylum commented Dec 13, 2023 via email

@cademirch
Copy link
Collaborator

Unfortunately I wasn't able to recreate this by pulling a fresh copy of the repo and running the test. Can you try that?

@Erythroxylum
Copy link
Author

Erythroxylum commented Dec 13, 2023 via email

@cademirch
Copy link
Collaborator

cademirch commented Dec 13, 2023 via email

@Erythroxylum
Copy link
Author

Erythroxylum commented Dec 13, 2023 via email

@Erythroxylum
Copy link
Author

Erythroxylum commented Dec 13, 2023 via email

@tsackton
Copy link
Contributor

snakemake will build its own conda environment for each rule; all you need in the snakemake/snparcher env is snakemake itself.

@Erythroxylum
Copy link
Author

Erythroxylum commented Dec 13, 2023 via email

@tsackton
Copy link
Contributor

I think this has something to do with the mamba/conda setup. I cannot replicate this error either, even on the same cluster. Can you perhaps list all the commands you are running exactly as you typed them? Not just the snakemake command, but basically everything you type from when you log on to the cluster to when you get the error message?

@Erythroxylum
Copy link
Author

Erythroxylum commented Dec 14, 2023 via email

@tsackton
Copy link
Contributor

Reopening this issue because I suspec this has to do with a conflict between the python version that is specified in https://github.com/harvardinformatics/snpArcher/blob/main/workflow/envs/cov_filter.yml and the python version the user builds snpArcher against.

I suspect we need to remove the python from the cov_filter.yml

@tsackton tsackton reopened this Dec 19, 2023
@Dictionary2b
Copy link

I had the same error on the previous attempt. It was solved by manually installing the pyd4 package to the env. The alternative is pinning the Python version to 3.10 since the default in my system was 3.11, where snparcher would have difficulty installing pyd4. I haven't test the second solution.

@simonharnqvist
Copy link

simonharnqvist commented Feb 1, 2024

After a lot of swearing at the cluster, I finally got this to work - the trick (on my system) is to install pyd4 into the main snparcher environment, not just into the cov_filter one.

This might have something to do with the fact that I've had to install each of the snparcher environments manually - Snakemake insisted on trying (and failing) to re-create the environments when running offline, even after pre-installing with --use-conda --conda-create-envs-only.

Either way, it's an easy workaround and might hopefully help someone else with this issue.

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

5 participants