jtamames / SqueezeMeta

A complete pipeline for metagenomic analysis
GNU General Public License v3.0
365 stars 78 forks source link

error in anvi-load-sqm.py #588

Closed fconstancias closed 1 year ago

fconstancias commented 1 year ago

Dear SQM developpers,

I am facing the following error when trying to load my SQM result into anvio.


(anvio-7.1) constancias@scelse:/datadrive05/Flo/NRP72/SQM/chicken2$ python3 /home/constancias/miniconda3/envs/SqueezeMeta160321/bin/anvi-load-sqm.py \
> -p chicken2 -o chicken2/results/anvio --num-threads 10 --min-contig-length 750 --run-HMMS
Traceback (most recent call last):
  File "/home/constancias/miniconda3/envs/SqueezeMeta160321/bin/anvi-load-sqm.py", line 57, in <module>
    import anvio
ModuleNotFoundError: No module named 'anvio'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/constancias/miniconda3/envs/SqueezeMeta160321/bin/anvi-load-sqm.py", line 59, in <module>
    raise Exception('Anvi\'o has not been detected. Are you sure that it has been activated?')
Exception: Anvi'o has not been detected. Are you sure that it has been activated?

anvio is properly installed in the conda environment.

(anvio-7.1) constancias@scelse:/datadrive05/Flo/NRP72/SQM/chicken2$ anvi-self-test --version
Anvi'o .......................................: hope (v7.1)

Profile database .............................: 38
Contigs database .............................: 20
Pan database .................................: 15
Genome data storage ..........................: 7
Auxiliary data storage .......................: 2
Structure database ...........................: 2
Metabolic modules database ...................: 2
tRNA-seq database ............................: 2

I got similar results with anvio-7. Is there anything wrong withy my install?

ggnatalia commented 1 year ago

Hi,

I'm not sure what could be happening. Maybe it is something related with some anvi'o paths. Could you show me the following paths:

which anvi-self-test

It should be something like these:

/path2/miniconda3/envs/anvio-7.1/bin/anvi-self-test

From here, check where the anvio python module is. You can take the first part to see where anvio environment is defined and then do:

ls /path2/miniconda3/envs/anvio-7.1/lib/python3.6/site-packages/

Here, do you have a folder called anvio?

fconstancias commented 1 year ago

These are the outputs:

which anvi-self-test

Everything seems correct but I can see that somehow my anvio-7.1 conda is installed inside the atlas-metagenomes one - at least in terms of directory structure.

I can see that somehow

fconstancias commented 1 year ago

I can confirm this was due to some mess in my conda environments.

source /home/constancias/miniconda3/etc/profile.d/conda.sh
conda activate anvio-7
python3 /home/constancias/miniconda3/envs/SqueezeMeta160321/bin/anvi-load-sqm.py 

anvi-load-sqm.py works now

ggnatalia commented 1 year ago

Ok! Nice then!