HRGV / phyloFlash

phyloFlash - A pipeline to rapidly reconstruct the SSU rRNAs and explore phylogenetic composition of an illumina (meta)genomic dataset.
GNU General Public License v3.0
77 stars 25 forks source link

problem in installing phyloflash #129

Closed mars188 closed 2 years ago

mars188 commented 3 years ago

Hello,

I created a conda environment and installed sortmerna with the following command: conda install sortmerna=2.1b Next, I tried installing phyloflash with the following command:
conda install phyloflash but ended up with the following error message:

Collecting package metadata (repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Solving environment: \ Found conflicts! Looking for incompatible packages. failed

UnsatisfiableError: The following specifications were found to be incompatible with the existing python installation in your environment:

Specifications:

Your python: python=3.9

If python is on the left-most side of the chain, that's the version you've asked for. When python appears to the right, that indicates that the thing on the left is somehow not available for the python version you are constrained to. Note that conda will not change your python version to a different minor version unless you explicitly specify that.

Does that mean I need to have python 2.7? and it will not work with my current python package?

kbseah commented 3 years ago

Hello, The Emirge dependency in the phyloFlash recipe requires python2. Could you try making a new environment, installing both sortmerna and phyloflash at the same time? I.e. conda create -n pf sortmerna=2.1b phyloflash

Check that you have the channels specified in the correct order, and try the option --strict-channel-priority if it hangs while solving the environment. Generally speaking if installing multiple packages to a Conda environment it is better to install them at the same time, and to create a separate environment for them instead of installing to an existing environment. Installing them sequentially will sometimes break dependencies or result in conflicts. We'll update the advice in the documentation accordingly. Thanks for bringing this up. Cheers, Brandon

mars188 commented 3 years ago

Awesome. I tried your method and it worked. Thank you so much for your help.

ghidalgo93 commented 3 years ago

Hello,

I am also trying to create a conda environment with phloflash and am running into the hanging issue many report, but the fixes many folks report as well as the docs from phyloflash are not working for me. I am trying to install phyloflash with genometools, but after some failures there I figured I would start with the default install of phyloflash + sortmerna.

Steps to recreate:

1) Set up channels and set strict channel priority

conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge

conda config --set channel_priority strict

2) create conda environment:

conda create -n pf phyloflash sortmerna=2.1b

3) Gets hung up on environment solving. Turned on verbose debug messages:

...
DEBUG conda.resolve:solve(1346): Solve: minimize removed packages
DEBUG conda.resolve:solve(1353): Solve: maximize versions of requested packages
DEBUG conda.common._logic:minimize(664): Empty objective, trivial solution
DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 64164
DEBUG conda.common._logic:minimize(745): Final peak objective: 0
DEBUG conda.resolve:solve(1357): Initial package channel/version metric: 0/0
DEBUG conda.resolve:solve(1360): Solve: minimize track_feature count
DEBUG conda.resolve:generate_feature_count(933): generate_feature_count returning with clause count: 64510
DEBUG conda.common._logic:minimize(658): Clauses added, recomputing solution
DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 64510
DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 64520
DEBUG conda.common._logic:minimize(745): Final sum objective: 0
DEBUG conda.resolve:solve(1363): Track feature count: 0
DEBUG conda.common._logic:minimize(658): Clauses added, recomputing solution
DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 64604
DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 64632
DEBUG conda.common._logic:minimize(745): Final sum objective: 0
DEBUG conda.resolve:solve(1374): Package misfeature count: 0
DEBUG conda.resolve:solve(1377): Solve: maximize build numbers of requested packages
DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 64639
DEBUG conda.common._logic:minimize(745): Final peak objective: 0
DEBUG conda.resolve:solve(1379): Initial package build metric: 0
DEBUG conda.resolve:solve(1382): Solve: prefer arch over noarch for requested packages
DEBUG conda.common._logic:minimize(664): Empty objective, trivial solution
DEBUG conda.resolve:solve(1384): Noarch metric: 0
DEBUG conda.resolve:solve(1388): Solve: minimize number of optional installations
DEBUG conda.common._logic:minimize(664): Empty objective, trivial solution
DEBUG conda.resolve:solve(1391): Optional package install metric: 0
DEBUG conda.resolve:solve(1394): Solve: minimize number of necessary upgrades
DEBUG conda.common._logic:minimize(664): Empty objective, trivial solution
DEBUG conda.resolve:solve(1397): Dependency update count: 0
DEBUG conda.resolve:solve(1400): Solve: maximize versions and builds of indirect dependencies. Prefer arch over noarch where equivalent.
DEBUG conda.common._logic:minimize(664): Empty objective, trivial solution
DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 69690
DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 64707
DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 64956
DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 65607
DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 66968
DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 65950
DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 65773
DEBUG conda.common._logic:minimize(745): Final peak objective: 9
DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 6093081
DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 3060137
DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 1568821
DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 845385
DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 1214050
DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 1397225
DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 1481769
DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 1436997
DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 1414611 

This were the last messages I received.


I have also tried manually create an environment with python2 (as was suggested might be necessary for the emirge dependency):

conda create -n pf python=2.7.16 phyloflash sortmerna=2.1b

Build failed (can post error message if desired, but I didn't want to make this any longer than necessary)

kbseah commented 3 years ago

Could you try using Mamba instead of Conda? Mamba is a drop-in substitute for Conda. With an existing Conda installation, simply install it to the base environment as described here: https://mamba.readthedocs.io/en/latest/installation.html

Thereafter use the command mamba create -n pf phyloflash sortmerna=2.1b instead of conda create ...

The Conda environment solver has been slow and buggy for some time. Using Mamba appears to help improve performance generally (not just for installing phyloFlash), e.g. it is now the default conda frontend for Snakemake.

ghidalgo93 commented 3 years ago

Unfortunately not at the moment, I'm working on an hpc cluster where we can't modify the base environment. I will mention this issue to our sysadmins and see if that's something we could think about going forward -- thanks for the info.

kbseah commented 3 years ago

Alright, hope that this works out. Btw it's actually recommended to install conda as a local user rather than system wide ( https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html). One possibility is to install miniconda to your user home folder, to which you should have write access, and use conda from that environment instead. But the details would depend heavily on your cluster setup and policies, so I can't say much more beyond that here.