# installing plugins within qiime2 singularity

**URL:** https://forum.qiime2.org/t/installing-plugins-within-qiime2-singularity/28751
**Category:** Technical Support
**Created:** [December 29, 2023, 9:47pm UTC](https://forum.qiime2.org/t/installing-plugins-within-qiime2-singularity/28751 "2023-12-29T21:47:29Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![anapopov](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/a/c89c15/32.png) [@anapopov](https://forum.qiime2.org/u/anapopov)
#### Post date: [December 29, 2023, 9:47pm UTC](https://forum.qiime2.org/t/installing-plugins-within-qiime2-singularity/28751/1 "2023-12-29T21:47:29Z")

</div>

Hi,  
I am looking for some help with installing plugins within a qiime2 singularity container.

I would like to add DEICODE and rescript, but although I was kindly directed to instructions for doing this in a docker container [[Installing Community Plugins in Docker](https://forum.qiime2.org/t/installing-community-plugins-in-docker/7106/1)], the cluster I have access to only allows singularity.

I built a singularity file using "singularity pull docker://quay.io/qiime2/core:2023.2" (also previously 2021.11) - they work well. I did try to install deicode using "conda install -c conda-forge deicode" once I activated the qiime2 interactive mode with "singularity shell qiime2-2023.2.sif" but I ran into dependency and permissions issues. It failed in the end. A bit of a novice when it comes to working within containers.

Details below. Any help appreciated!

version qiime: qiime2-2023.2 (singularity)

plugin install commands tried:

1. conda install -c conda-forge deicode

outcome: "Downloading and Extracting Packages  
Preparing transaction: done  
Verifying transaction: failed

```
              EnvironmentNotWritableError: The current user does not have write 
              permissions to the target environment"

```

1. conda install -c conda-forge deicode --no-update-deps

outcome: "Solving environment: failed with initial frozen solve. Retrying with flexible solve.", then "Solving environment: | CPU time limit exceeded"

1. conda install -c conda-forge deicode conda=23.1.0

outcome: same as in #1

1. installing it within its own conda environment with "pip install deicode" returned:  
"Recursion error: maximum recursion depth exceeded while calling a Python object"

---

<div class="post-metadata">

### Author: ![lizgehret](https://forum.qiime2.org/user_avatar/forum.qiime2.org/lizgehret/32/17128_2.png) [@lizgehret](https://forum.qiime2.org/u/lizgehret)
#### Post date: [December 29, 2023, 11:06pm UTC](https://forum.qiime2.org/t/installing-plugins-within-qiime2-singularity/28751/2 "2023-12-29T23:06:17Z")

</div>

Hi @anapopov!

I am not super familiar with using singularity (@colinbrislawn might have more insight on this) - but based on the error you're receiving it seems like a user permissions issue related to your conda configuration. Do you have access to update the conda config on this cluster?

---

<div class="post-metadata">

### Author: ![colinbrislawn](https://forum.qiime2.org/user_avatar/forum.qiime2.org/colinbrislawn/32/6221_2.png) [@colinbrislawn](https://forum.qiime2.org/u/colinbrislawn)
#### Post date: [December 30, 2023, 3:25am UTC](https://forum.qiime2.org/t/installing-plugins-within-qiime2-singularity/28751/3 "2023-12-30T03:25:01Z")

</div>

> [@lizgehret](#):
>
> user permissions issue

This could also be related to the `user` inside the container image. I've not checked how Qiime2 does it, but often when the container disk image is being built, certain build steps take place with different user scopes. Also, image layers are immutable (by design)

This means singularity can make unwritable conda stuff. See:  
[https://github.com/conda/conda/issues/7267#issuecomment-458661530](https://github.com/conda/conda/issues/7267#issuecomment-458661530)

* * *

While I'm here,

> [@anapopov](#):
>
> the cluster I have access to only allows singularity.  
> ...  
> A bit of a novice when it comes to working within containers.

I appreciate your tenacity in working with containers! That's awesome!

Whoever made the 'singularity only' rule on this cluster could/should also help you use singularity to get this running. 🐋 🚀

---

<div class="post-metadata">

### Author: ![anapopov](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/a/c89c15/32.png) [@anapopov](https://forum.qiime2.org/u/anapopov)
#### Post date: [January 3, 2024, 7:09pm UTC](https://forum.qiime2.org/t/installing-plugins-within-qiime2-singularity/28751/4 "2024-01-03T19:09:42Z")

</div>

Okay, thanks @colinbrislawn, and also @lizgehret !  
I'll read up some more and try the cluster tech team.  
🙂

---

<div class="post-metadata">

### Author: ![anapopov](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/a/c89c15/32.png) [@anapopov](https://forum.qiime2.org/u/anapopov)
#### Post date: [January 9, 2024, 6:29pm UTC](https://forum.qiime2.org/t/installing-plugins-within-qiime2-singularity/28751/5 "2024-01-09T18:29:13Z")

</div>

In case someone else is using qiime with singularity/apptainer, the instructions below were kindly provided by my cluster tech support for installing plugins:

* * *

Singularity (now is rebranded to apptainer) uses sif which is a  
read-only image. To update an apptainer image requires a few steps.

1. build a sandbox which is a directory ("sb") in which you can modify the content  
apptainer build --sandbox sb docker://quay.io/qiime2/core:2023.2

2. ensure the directory (sb/opt) is writeable and/or change permissions

3. activate this sandbox, as your container  
apptainer shell --contain --writable sb

4. update the sandbox  
Apptainer\> conda install -c conda-forge deicode

5. pack the sandbox as a sif  
apptainer build my\_updated.sif sb

Note you may need to remove/rename your $HOME/.cache directory in  
order for the above conda to proceed.

---

<div class="post-metadata">

### Author: ![lizgehret](https://forum.qiime2.org/user_avatar/forum.qiime2.org/lizgehret/32/17128_2.png) [@lizgehret](https://forum.qiime2.org/u/lizgehret)
#### Post date: [January 9, 2024, 6:40pm UTC](https://forum.qiime2.org/t/installing-plugins-within-qiime2-singularity/28751/6 "2024-01-09T18:40:06Z")

</div>

This is helpful, thanks for following up with this info @anapopov! 🙂

---

<div class="post-metadata">

### Author: ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)
#### Post date: [February 10, 2024, 12:40am UTC](https://forum.qiime2.org/t/installing-plugins-within-qiime2-singularity/28751/7 "2024-02-10T00:40:37Z")

</div>

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
