merenlab / anvio

An analysis and visualization platform for 'omics data
http://merenlab.org/software/anvio
GNU General Public License v3.0
431 stars 145 forks source link

[BUG] Python version is incompatible with Anvi'o #2347

Closed okcoskun closed 1 week ago

okcoskun commented 1 week ago

Short description of the problem

Unable to install anvi'o-8 because of python version.

anvi'o version

anvio-8

System info

system: x86_64 GNU/Linux

Conda version

conda version: conda 24.7.1

Detailed description of the issue

I am trying to install anvio-8 using conda on our in-house server, but keep getting the following issue:

anvi-self-test --version

========================================================
🦄 SOMETHING BAD HAPPENED AND IT NEEDS YOUR ATTENTION 🦄
========================================================
The environment in which you're running anvi'o has a Python 
version that is not compatible with the Python version 
requirement of anvi'o you are running. Here is a summary: 

    Anvi'o version you have ..............: 8 (marie)
    Python version you have ..............: 3.9.20
    Python version anvi'o wants ..........: 3.10.*

This should never have happened with a stable anvi'o release :/ 
Please follow the most up-to-date installation instructions at 
https://anvio.org/install/ to re-install anvi'o and its environment.

I noticed that the following finding if it helps you to figure out what is going on:

conda create -y --name anvio-8.new python=3.10
conda activate anvio-8.new
python --version
Python 3.10.15

Then after running:

conda install -y -c conda-forge -c bioconda python=3.10 \
        sqlite prodigal idba mcl muscle=3.8.1551 famsa hmmer diamond \
        blast megahit spades bowtie2 bwa graphviz "samtools>=1.9" \
        trimal iqtree trnascan-se fasttree vmatch r-base r-tidyverse \
        r-optparse r-stringi r-magrittr bioconductor-qvalue meme ghostscript

# try this, if it doesn't install, don't worry (it is sad, but OK):
conda install -y -c bioconda fastani

The python version is downgraded:

python --version
Python 3.9.20

I continued installing the anvio using pip installation. Do you think that during the installation of one of these softwares, python is downgraded?

Could you please help on this issue?

meren commented 1 week ago

Sorry, @okcoskun, never run into this issue. None of the installation steps should downgrade the Python version.

In case fastani is doing that, you can try to install it using this line instead after generating a new conda environment from scracth:

conda install -y -c bioconda python=3.10 fastani

Or you can remove -y from both commands, and see the list of upgrades and downgrades conda is intending to do. If you see Python there, you will also know which program requires it.

okcoskun commented 1 week ago

Dear @meren,

Thank you for your prompt answer! I think that the packages that anvi'o is deploying were not downgrading the python version. I have tested this by installing four packages individually. After every installation, pyhton version was showing 3.9.20, which is the version of my base conda environment.

In case, someone else encounters with the same problem, I have resolved it by upgrading the pyhton version in base conda environment. This might be risky for other users because it might create conflicts with other packages/programs. In my case, anvi'o is the only program that I am using in my conda environment, so everything should be OK.

After this, "anvi-self-test --suite mini" worked like a charm.

However, snakemake threw an error like in the case of #2290. I have also solved this by changing the pulp version in the base conda environment.

Thanks for your help!

All the best,

Ömer

meren commented 1 week ago

Thank you so much for reporting back, @okcoskun, and I'm very glad that you were able to resolve the issue!

Best wishes,