jiarong / VirSorter2

customizable pipeline to identify viral sequences from (meta)genomic data
GNU General Public License v2.0
221 stars 31 forks source link

libmamba Non-conda folder exists at prefix #222

Open joelive opened 1 week ago

joelive commented 1 week ago

When I run the virsorter setup command, it always report error.

(virsort2) bo@bioinofo2:~$ virsorter setup -d virsorter_db/ [2024-10-24 02:47 INFO] VirSorter 2.2.4 [2024-10-24 02:47 INFO] /home/bo/miniconda3/envs/virsort2/bin/virsorter setup -d virsorter_db/ [2024-10-24 02:47 INFO] Setting up VirSorter2 database; this might take ~10 mins and only needs to be done once. [2024-10-24 02:47 INFO] saving /home/bo/virsorter_db as DBDIR to config file /home/bo/miniconda3/envs/virsort2/lib/python3.10/site-packages/virsorter/template-config.yaml CreateCondaEnvironmentException: Could not create conda environment from /home/bo/miniconda3/envs/virsort2/lib/python3.10/site-packages/virsorter/rules/../envs/vs2.yaml: error libmamba Non-conda folder exists at prefix critical libmamba Aborting.

File "/home/bo/miniconda3/envs/virsort2/lib/python3.10/site-packages/snakemake/deployment/conda.py", line 350, in create [2024-10-24 02:47 ERROR] CreateCondaEnvironmentException: Could not create conda environment from /home/bo/miniconda3/envs/virsort2/lib/python3.10/site-packages/virsorter/rules/../envs/vs2.yaml: error libmamba Non-conda folder exists at prefix critical libmamba Aborting.

File "/home/bo/miniconda3/envs/virsort2/lib/python3.10/site-packages/snakemake/deployment/conda.py", line 350, in create [2024-10-24 02:47 INFO] First attempt failed; trying the second time. CreateCondaEnvironmentException: Could not create conda environment from /home/bo/miniconda3/envs/virsort2/lib/python3.10/site-packages/virsorter/rules/../envs/vs2.yaml: error libmamba Non-conda folder exists at prefix critical libmamba Aborting.

File "/home/bo/miniconda3/envs/virsort2/lib/python3.10/site-packages/snakemake/deployment/conda.py", line 350, in create [2024-10-24 02:47 CRITICAL] Command 'snakemake --snakefile /home/bo/miniconda3/envs/virsort2/lib/python3.10/site-packages/virsorter/rules/setup-retry.smk --directory /home/bo/virsorter_db --quiet --config Skip_deps_install=False --jobs 64 --rerun-incomplete --latency-wait 600 --nolock --use-conda --conda-prefix /home/bo/virsorter_db/conda_envs --conda-frontend mamba ' returned non-zero exit status 1.

ChaoLab commented 1 week ago

Hi Jiarong, I have the same issue as @joelive. I guess it is a conda env setting-up problem. Can you help to solve this issue?

Best, Chao

jiarong commented 1 week ago

Sorry, I was quite busy last week. If you do not have to conda/mamba, I recommend installation option 3. Or else, try to remove the database directory (/home/bo/virsorter_db) and rerun virsorter setup. It looks like there was an failed attempt before.

handibles commented 5 days ago

Seeing this also on a fresh env. After failed installs, there's a conda_envs dir created in the chosen db dir, possibly mamba is attempting to install the setup.smk dependencies alongside the database, which is going awry (i.e. non-conda folder). See line:471 of virsorter.py, and possibly line:155 of setup.smk.

In any case: doing all of the below:

allowed setup to complete, but does not allow virsorter to run - the error is ~same as the above:

[2024-10-31 16:21 INFO] /mnt/workspace2/jamie/miniforge3/envs/pha/bin/virsorter run -w /mnt/workspace2/jamie/mtu__phamm/6__virsorter/vsort_SPA_ERR10157887 -i /mnt/workspace2/jamie/mtu__phamm/4__spades/ERR10157887/contigs.fasta --min-length 10000 -j 8                                                                                                     
[2024-10-31 16:21 INFO] Using /mnt/workspace2/jamie/miniforge3/envs/pha/lib/python3.10/site-packages/virsorter/template-config.yaml as config template                                                                                    
[2024-10-31 16:21 INFO] conig file written to /mnt/workspace2/jamie/mtu__phamm/6__virsorter/vsort_SPA_ERR10157887/config.yaml                                                                                                             

[2024-10-31 16:21 INFO] Executing: snakemake --snakefile /mnt/workspace2/jamie/miniforge3/envs/pha/lib/python3.10/site-packages/virsorter/Snakefile --directory /mnt/workspace2/jamie/mtu__phamm/6__virsorter/vsort_SPA_ERR10157887 --jobs 8 --configfile /mnt/workspace2/jamie/mtu__phamm/6__virsorter/vsort_SPA_ERR10157887/config.yaml --latency-wait 600 --rerun-incomplete --nolock  --conda-frontend mamba --conda-prefix /mnt/workspace2/jamie/vdb/conda_envs --use-conda    --quiet  all                                                                                                         
CreateCondaEnvironmentException:                                                                                     
Could not create conda environment from /mnt/workspace2/jamie/miniforge3/envs/pha/lib/python3.10/site-packages/virsorter/rules/../envs/vs2.yaml:                                                                                          
error    libmamba Non-conda folder exists at prefix                                                                  
critical libmamba Aborting.                                                                                          

  File "/mnt/workspace2/jamie/miniforge3/envs/pha/lib/python3.10/site-packages/snakemake/deployment/conda.py", line 350, in create                  
joelive commented 5 days ago

I have solved the problem by mamually mamba install all packages

handibles commented 5 days ago

I have solved the problem by mamually mamba install all packages

@joelive glad it works! My comment above doesn't allow you to run virsorter, as it still attempts a conda-env when you use virsorter run, and then it crashes - did you need to do anything else to stop conda getting upset?

jiarong commented 4 days ago

@all, I just had chance to test this. It looks like the new mamba version 2 is the issue. You can change to mamba version 1 to resolve this issue.

# get into the vs2 env
conda activate vs2
# downgrade mamba to v1
mamba installl -c conda-forge mamba=1
anniedussault commented 4 hours ago

thanks @jiarong thanks for the solution! I was able to install your app and run it!