cbg-ethz / cojac

GNU General Public License v3.0
18 stars 5 forks source link

yaml module not found #9

Open suskraem opened 2 years ago

suskraem commented 2 years ago

Hello, I installed cojac using conda within a virtual environment (mac monterey) conda create -n cojac conda activate cojac conda install cojac but am now encountering the following error when testing: cooc-mutbamscan --help Traceback (most recent call last): File "/Users/susanne/opt/anaconda3/envs/cojac/bin/cooc-mutbamscan", line 10, in import yaml ModuleNotFoundError: No module named 'yaml' I tried to install yaml via conda and pip, as well as homebrew. When I just use python within the cojac environment I can import the module, but I can't appear to solve the error. Thank you and any help is appreciated, Susanne

DrYak commented 2 years ago

tried to install yaml via conda

Please note that in conda, the python module is called pyyaml (whereas yaml refers to the C library)

import yaml ModuleNotFoundError: No module named 'yaml'

This is extremely strange because pyyaml is listed as a hard dependency of cojac, and cooc-mutbamscan --help is part of the quick tests done as part of the conda package self-test.

I can't manage to reproduce:

$ conda install cojac
Collecting package metadata (current_repodata.json): done
…
The following NEW packages will be INSTALLED:
…
  cojac              bioconda/noarch::cojac-0.2-hdfd78af_0
…
  pyyaml             conda-forge/linux-64::pyyaml-6.0-py39h3811e60_3
…
  ruamel.yaml        conda-forge/linux-64::ruamel.yaml-0.17.21-py39h3811e60_0
  ruamel.yaml.clib   conda-forge/linux-64::ruamel.yaml.clib-0.2.6-py39h3811e60_0
…
  strictyaml         conda-forge/noarch::strictyaml-1.3.2-pyh44b312d_0
…
  yaml               conda-forge/linux-64::yaml-0.2.5-h7f98852_2
…
Proceed ([y]/n)? 

Some questions:

DrYak commented 2 years ago

Another possible 1-liner you could run to try to debug:

python3 -c 'import sys; print("\n".join(sys.path))'

All the displayed search paths should all point within the conda environment (…/miniconda3/envs/cojac/lib/python…). None of them should point to you other python environment (to homebrew, etc.)

Lastly, the …/miniconda3/envs/cojac/lib/pythonx.y/site-packages directory listed before should contain a module called yaml.

suskraem commented 2 years ago

Thanks for your input! It's indeed a python path issue. Even though a new version of python is installed in the environment, the path points towards an installation in homebrew etc. Do you happen to know how to point towards the correct python within my cojac environment? Thank you very much!


From: DrYak @.> Sent: February 17, 2022 11:47 AM To: cbg-ethz/cojac @.> Cc: Susanne Kramer @.>; Author @.> Subject: Re: [cbg-ethz/cojac] yaml module not found (Issue #9)

Another possible 1-liner you could run to try to debug:

python3 -c 'import sys; print("\n".join(sys.path))'

All the displayed search paths should all point within the conda environment (…/miniconda3/envs/cojac/lib/python…). None of them should point to you other python environment (to homebrew, etc.)

Lastly, the …/miniconda3/envs/cojac/lib/pythonx.y/site-packages directory listed before should contain a module called yaml.

— Reply to this email directly, view it on GitHubhttps://github.com/cbg-ethz/cojac/issues/9#issuecomment-1043172920, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANW626YMK52O6KL2G2B4WKTU3URAJANCNFSM5OVDLLKA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you authored the thread.Message ID: @.***>