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

ModuleNotFoundError when using pysam in conda environment #1282

Closed
ayushm64 opened this issue Apr 23, 2024 · 3 comments
Closed

ModuleNotFoundError when using pysam in conda environment #1282

ayushm64 opened this issue Apr 23, 2024 · 3 comments

Comments

@ayushm64
Copy link

I am running a snakemake workflow from this github repo the workflow runs in two conda environments. One of the two environments requires pysam as a dependency, but when I ran the workflow I received a ModuleNotFoundError for pysam and when I ran conda list within the environment I saw that pysam was not installed. After manually activating the conda environment and installing pysam 0.20.0 (the version the repo was tested with), I ran the workflow again and I still receive the same error. This is despite verifying that pysam is now in the environment using conda list while the environment is activated. Here is the terminal output when I manually activate the environment and explicitly execute the problematic script:

(/home/ayush/evo-genome-analysis/.snakemake/conda/e7058f7e8daa0d39e1ca146fe09d6f2d_) ayush@DESKTOP-45HGJK1:~/evo-genome-analysis$ python3 scripts/pileup/extract_nonprimary.py             --bam test_data/output/mapped_reads/RefWT113017-W/E8G_trimmed_WTRef_bow_sorted_collated.bam --csv test_data/output/pileup/RefWT113017-W/non_primary/E8G_trimmed_WTRef_bow_sorted_collated/non_primary.csv
        
Traceback (most recent call last):
  File "/home/ayush/evo-genome-analysis/scripts/pileup/extract_nonprimary.py", line 1, in <module>
    import pysam
ModuleNotFoundError: No module named 'pysam'

What could be the cause of this? Please let me know if I need to provide any additional information. Thank you!

@ErikaKvalem
Copy link

I have the same issue. The pysam version installed:
pysam 0.21.0 py36h50b03f4_0 bioconda

@jmarshall
Copy link
Member

What version of python is being run? Probably this is #1202, which is a bioconda issue.

@ayushm64
Copy link
Author

Yes I was using python 3.11. I switched to python 3.10 in the environment and the issue seems to be resolved. Thank you!

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

3 participants