Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libmamba Non-conda folder exists at prefix #222

Open
joelive opened this issue Oct 24, 2024 · 15 comments
Open

libmamba Non-conda folder exists at prefix #222

joelive opened this issue Oct 24, 2024 · 15 comments

Comments

@joelive
Copy link

joelive commented Oct 24, 2024

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
Copy link

ChaoLab commented Oct 27, 2024

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
Copy link
Owner

jiarong commented Oct 28, 2024

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
Copy link

handibles commented Oct 31, 2024

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:

  • A fresh mamba env
  • deleting the target db dir
  • using -s(kip-dependencies) during virsorter setup

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
Copy link
Author

joelive commented Oct 31, 2024

I have solved the problem by mamually mamba install all packages

@handibles
Copy link

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
Copy link
Owner

jiarong commented Nov 2, 2024

@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
Copy link

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

@sohini5981
Copy link

Hello @jiarong

I have installed vs2 using mamba (ver 1.5.9)
base * /storage/home/svg5863/miniforge3
vs2 /storage/home/svg5863/miniforge3/envs/vs2. However, the problem @joelive faced persists for me. When I try to setup the db folder, the job exists with the following errors:

/storage/home/svg5863/miniforge3/envs/vs2/bin/virsorter setup -d db -j 4
[2024-11-22 13:05 INFO] Setting up VirSorter2 database; this might take ~10 mins and only needs to be done once.
[2024-11-22 13:05 INFO] saving /storage/home/svg5863/db as DBDIR to config file /storage/home/svg5863/miniforge3/envs/vs2/lib/python3.10/site-packages/virsorter/template-config.yaml
CreateCondaEnvironmentException:
Could not create conda environment from /storage/home/svg5863/miniforge3/envs/vs2/lib/python3.10/site-packages/virsorter/rules/../envs/vs2.yaml:
/storage/home/svg5863/miniforge3/envs/vs2/lib/python3.10/argparse.py:1930: FutureWarning: remote_definition is deprecated and will be removed in 25.9. Use conda env create --file=URL instead.
action(self, namespace, argument_values, option_string)
Collecting package metadata (repodata.json): ...working...
File "/storage/home/svg5863/miniforge3/envs/vs2/lib/python3.10/site-packages/snakemake/deployment/conda.py", line 350, in create
[2024-11-22 13:06 ERROR] CreateCondaEnvironmentException:
Could not create conda environment from /storage/home/svg5863/miniforge3/envs/vs2/lib/python3.10/site-packages/virsorter/rules/../envs/vs2.yaml:
/storage/home/svg5863/miniforge3/envs/vs2/lib/python3.10/argparse.py:1930: FutureWarning: remote_definition is deprecated and will be removed in 25.9. Use conda env create --file=URL instead.
action(self, namespace, argument_values, option_string)
Collecting package metadata (repodata.json): ...working...
File "/storage/home/svg5863/miniforge3/envs/vs2/lib/python3.10/site-packages/snakemake/deployment/conda.py", line 350, in create
[2024-11-22 13:06 INFO] First attempt failed; trying the second time.
CreateCondaEnvironmentException:
Could not create conda environment from /storage/home/svg5863/miniforge3/envs/vs2/lib/python3.10/site-packages/virsorter/rules/../envs/vs2.yaml:
/storage/home/svg5863/miniforge3/envs/vs2/lib/python3.10/argparse.py:1930: FutureWarning: remote_definition is deprecated and will be removed in 25.9. Use conda env create --file=URL instead.
action(self, namespace, argument_values, option_string)
Collecting package metadata (repodata.json): ...working...
File "/storage/home/svg5863/miniforge3/envs/vs2/lib/python3.10/site-packages/snakemake/deployment/conda.py", line 350, in create
[2024-11-22 13:07 CRITICAL] Command 'snakemake --snakefile /storage/home/svg5863/miniforge3/envs/vs2/lib/python3.10/site-packages/virsorter/rules/setup-retry.smk --directory /storage/home/svg5863/db --quiet --config Skip_deps_install=False --jobs 4 --rerun-incomplete --latency-wait 600 --nolock --use-conda --conda-prefix /storage/home/svg5863/db/conda_envs --conda-frontend mamba ' returned non-zero exit status 1.
Any advice??

@anniedussault
Copy link

@sohini5981 Have you tried the solution here ? #222 (comment)

I had a smilar issue to what you're describing and this resolved my issue. I would start with that!

@jiarong
Copy link
Owner

jiarong commented Nov 23, 2024

@sohini5981 Have you tried the solution here ? #222 (comment)

I had a smilar issue to what you're describing and this resolved my issue. I would start with that!

Right, it's the same issue. The trick is to change mamba within the VS2 env. The problem is the mamba within the VS2 env, not the mamba in your base env.

@sohini5981
Copy link

sohini5981 commented Nov 23, 2024 via email

@jiarong
Copy link
Owner

jiarong commented Dec 6, 2024

@ALL, I have fixed this issue in bioconda version. Just upgarde and you should be able to run w/o manually downgrading mamba to v1.

@bioinfogini
Copy link

@jiarong thanks for posting the solution about downgrading mamba when facing libmamba Non-conda folder exists at prefix Error! It worked also for issues not related to VirStorter2, but to Metagenome atlas as well!

@SilasK
Copy link

SilasK commented Dec 17, 2024

Thank you for the fix. any idea hopw this could be permanently solved. libmamba v1 is no longer maintained and eventually we should swicht to v2..

@jiarong
Copy link
Owner

jiarong commented Dec 17, 2024

My understanding is that the issue is caused by the incompatibility between snakemake and mamba2. We can switch back to conda since it's conda's resolver is pretty decent now, or just wait till snakemake resolve the issue with mamba2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants