The bioBakery help forum

Strainphlan sample2markers.py no module named cmseq

Hello,
Thanks for these awesome tools.
my code:

sample2markers.py -i /home/ep189/strainer_tutorial/sams/*.sam.bz2 -o /home/ep189/strainer_tutorial/consensus_markers -n 8

the error I got:
Traceback (most recent call last):
File “/home/ep189/.local/bin/sample2markers.py”, line 11, in
load_entry_point(‘MetaPhlAn==3.0.0a1’, ‘console_scripts’, ‘sample2markers.py’)()
File “/usr/lib/python3.6/site-packages/pkg_resources/init.py”, line 476, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/lib/python3.6/site-packages/pkg_resources/init.py”, line 2700, in load_entry_point
return ep.load()
File “/usr/lib/python3.6/site-packages/pkg_resources/init.py”, line 2318, in load
return self.resolve()
File “/usr/lib/python3.6/site-packages/pkg_resources/init.py”, line 2324, in resolve
module = import(self.module_name, fromlist=[‘name’], level=0)
File “/home/ep189/.local/lib/python3.6/site-packages/metaphlan/utils/sample2markers.py”, line 24, in
from cmseq import cmseq
ModuleNotFoundError: No module named ‘cmseq’

I tried reinstalling cmseq with conda, but no luck. I installed metaphlan 3.0 with conda.
Any other suggestions? Thanks so much.

Hi @eperez
Could you please run the following commands and send me the results:
$ metaphlan -v
$ consensus.py -h
$ ls /home/ep189/.local/lib/python3.6/site-packages/cmseq

Best,
Aitor

Dear Aitor,
Here’s the results:

Warning! Biom python library not detected!
Exporting to biom format will not work!
MetaPhlAn version 3.0 (20 Mar 2020)

-bash: consensus.py: command not found

ls: cannot access /home/ep189/.local/lib/python3.6/site-packages/cmseq: No such file or directory

That’s odd… I know I installed cmseq but maybe there’s some other issue with python?
I’m on a cluster with python installed as a module for all users and I wonder if python on the module system is what metaphlan/strainphlan keeps referring to…!
Thanks for your help.
Elizabeth

Hi @eperez
Yes, that means cmseq was not installed correctly. Moreover, the MetaPhlAn version is quite old (the latest version is 3.0.7 (09 Dec 2020)).
For having a better idea about the problem, could you run:
$ whereis metaphlan
$ whereis sample2markers.py

Hi Aitor,

Ah, I see. I relatively recently installed with Conda, but I guess there have been some version updates since then! Will definitely try re-installing and then run those commands to see where it installs it and where the script is.
I did some digging, and yes, my metaphlan script locations were all messed up. I think for whatever reason an older version of Python I had on my directory caused the installations to go to randomly different folders. I’m going to start from scratch and re-install everything, including removing any other versions of python from my directory since it seems to be contributing to the problem.

I’ll get back about how the new installation goes after the holidays and send a reply with the outputs in this thread.
Thanks so much!
Elizabeth

Hi @eperez
Sure, Let us know!

Dear Aitor,

Just following up on this old thread,
I went to attempt to install the latest version on conda, and it looks like the version available on conda is still 3.0. I tried auto-updating with conda update, but I get an error that the package is not installed in prefix (yet, I see it is there…)
Apologies, I’m new to doing things with conda and using biobakery tools. So, I’ve reinstalled metaphlan, but it is still 3.0. Any suggestions?

consensus.py -h
command not found

ls /home/ep189/.local/lib/python3.6/site-packages/cmseq
ls: cannot access /home/ep189/.local/lib/python3.6/site-packages/cmseq: No such file or directory
^^ I got the above error after trying to install cmseq with conda as well.

whereis metaphlan
metaphlan: /home/ep189/.local/bin/metaphlan

whereis sample2markers.py
sample2markers: /home/ep189/.local/bin/sample2markers.py

I guess the good news is that now sample2markers.py is in the right place, but now it my terminal doesn’t detect cmseq.

Anything helps! Thanks
Elizabeth