# About q2-SCNIC installation

**URL:** https://forum.qiime2.org/t/about-q2-scnic-installation/20245
**Category:** Library Support
**Created:** [July 19, 2021, 11:03pm UTC](https://forum.qiime2.org/t/about-q2-scnic-installation/20245 "2021-07-19T23:03:46Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![WeedCentipede](https://forum.qiime2.org/user_avatar/forum.qiime2.org/weedcentipede/32/10549_2.png) [@WeedCentipede](https://forum.qiime2.org/u/WeedCentipede)
#### Post date: [July 19, 2021, 11:03pm UTC](https://forum.qiime2.org/t/about-q2-scnic-installation/20245/1 "2021-07-19T23:03:46Z")

</div>

Hello there!

I'm trying to figure out how to install and run SCNIC but facing my inhability to do it, I feel like a Gordon Ramsay's 🥪.

Lately I've reproduced errors ranging from the ones previously reported in [q2-SCNIC Correlations calculation #error plugin DataFrame to\_dense](https://forum.qiime2.org/t/q2-scnic-correlations-calculation-error-plugin-dataframe-to-dense/18460) and [q2 scnic fails in calculating correlations](https://forum.qiime2.org/t/q2-scnic-fails-in-calculating-correlations/18932) which apparently are due to the q2 environment version (mainly 2021.4, 2020.8, 2020.11); to other errors associated with the conda channel, pip installation, missing libraries (networkx and/or r-pillar=1.2.2 in q2-2018.8), no longer supported and conflicted envs (q2-2018.11), etc (I've lost count of all the errors so far).

My question: is this plugin still functional and ready to use? and if it is under what conditions needs to be installed in order to run properly?

Cheers,  
Luis Alfonso.

PD, I know this topic kinda resurfaces every two months so if it's redundant please don't accept it.

---

<div class="post-metadata">

### Author: ![kthurimella](https://forum.qiime2.org/user_avatar/forum.qiime2.org/kthurimella/32/9229_2.png) [@kthurimella](https://forum.qiime2.org/u/kthurimella)
#### Post date: [July 20, 2021, 4:22pm UTC](https://forum.qiime2.org/t/about-q2-scnic-installation/20245/2 "2021-07-20T16:22:24Z")

</div>

Hey Luis, did you have any issues installing the plugin using these commands: [https://library.qiime2.org/plugins/q2-scnic/11/](https://library.qiime2.org/plugins/q2-scnic/11/)?

---

<div class="post-metadata">

### Author: ![WeedCentipede](https://forum.qiime2.org/user_avatar/forum.qiime2.org/weedcentipede/32/10549_2.png) [@WeedCentipede](https://forum.qiime2.org/u/WeedCentipede)
#### Post date: [July 20, 2021, 11:35pm UTC](https://forum.qiime2.org/t/about-q2-scnic-installation/20245/3 "2021-07-20T23:35:41Z")

</div>

Hey Kumar,

Following the link's commands, installing with pip, in qiime 2021.2 (and other recent qiime2 versions), python 3.6.13, I get the following error:  
(qiime2-20212) [larteag7@apolo workdir-feb2021] pip install --user scnic  
Requirement already satisfied: scnic in /home/larteag7/.conda/envs/qiime2-20212/lib/python3.6/site-packages (0.6.2)  
Requirement already satisfied: networkx\>=2 in /home/larteag7/.conda/envs/qiime2-20212/lib/python3.6/site-packages (from scnic) (2.5)  
(qiime2-20212) [larteag7@apolo workdir-feb2021]$ pip install git+https://github.com/lozuponelab/q2-SCNIC.git  
Collecting git+https://github.com/lozuponelab/q2-SCNIC.git  
Cloning [GitHub - lozuponelab/q2-SCNIC: A QIIME2 plugin for running SCNIC](https://github.com/lozuponelab/q2-SCNIC.git) to /tmp/pip-req-build-sjg3ewpk  
Running command git clone -q [GitHub - lozuponelab/q2-SCNIC: A QIIME2 plugin for running SCNIC](https://github.com/lozuponelab/q2-SCNIC.git) /tmp/pip-req-build-sjg3ewpk  
Building wheels for collected packages: q2-SCNIC  
Building wheel for q2-SCNIC (setup.py) ... done  
Created wheel for q2-SCNIC: filename=q2\_SCNIC-2020.10+4.gf8566e7-py3-none-any.whl size=13659 sha256=fc8d940bcab83bfe52d67cefaeffd6b5b0528c84f9f02a27f21ba67c861c3447  
Stored in directory: /tmp/pip-ephem-wheel-cache-\_sk\_h2f1/wheels/64/7b/3c/5bcf3c4eb19280ce7539e810efd388ff14d07e9c5283f87c24  
Successfully built q2-SCNIC  
Installing collected packages: q2-SCNIC  
Attempting uninstall: q2-SCNIC  
Found existing installation: q2-SCNIC 2018.8.0+20.g07ffa4a  
Uninstalling q2-SCNIC-2018.8.0+20.g07ffa4a:  
Successfully uninstalled q2-SCNIC-2018.8.0+20.g07ffa4a  
Successfully installed q2-SCNIC-2020.10+4.gf8566e7

...

(qiime2-20212) [larteag7@apolo workdir-feb2021]$ qiime SCNIC calculate-correlations --i-table fake-data-filtered.qza --p-method sparcc --o-correlation-table fake-correls.qza  
Plugin error from SCNIC:

'DataFrame' object has no attribute 'to\_dense'

Debug info has been saved to /tmp/qiime2-q2cli-err-0dzoplyr.log  
(qiime2-20212) [larteag7@apolo workdir-feb2021]$ cat /tmp/qiime2-q2cli-err-0dzoplyr.log  
Correlating with sparcc  
Traceback (most recent call last):  
File "/home/larteag7/.conda/envs/qiime2-20212/lib/python3.6/site-packages/q2cli/commands.py", line 329, in **call**  
results = action(\*\*arguments)  
File "", line 2, in calculate\_correlations  
File "/home/larteag7/.conda/envs/qiime2-20212/lib/python3.6/site-packages/qiime2/sdk/action.py", line 245, in bound\_callable  
output\_types, provenance)  
File "/home/larteag7/.conda/envs/qiime2-20212/lib/python3.6/site-packages/qiime2/sdk/action.py", line 390, in _callable\_executor_  
output\_views = self.\_callable(\*\*view\_args)  
File "/home/larteag7/.conda/envs/qiime2-20212/lib/python3.6/site-packages/q2\_SCNIC/\_SCNIC\_methods.py", line 29, in calculate\_correlations  
correls = ca.fastspar\_correlation(table, verbose=True, nprocs=n\_procs)  
File "/home/larteag7/.conda/envs/qiime2-20212/lib/python3.6/site-packages/SCNIC/correlation\_analysis.py", line 77, in fastspar\_correlation  
table.to\_dataframe().to\_dense().to\_csv(path.join(temp, 'otu\_table.tsv'), sep='\t', index\_label='#OTU ID')  
File "/home/larteag7/.conda/envs/qiime2-20212/lib/python3.6/site-packages/pandas/core/generic.py", line 5141, in **getattr**  
return object. **getattribute** (self, name)  
AttributeError: 'DataFrame' object has no attribute 'to\_dense'

As someone mentioned before, in the same step if you use a different method, it works.

(qiime2-20212) [larteag7@apolo workdir-feb2021]$ qiime SCNIC calculate-correlations --i-table fake-data-filtered.qza --p-method pearson --o-correlation-table fake-correls.qza  
Saved PairwiseFeatureData to: fake-correls.qza

I read somewhere than in an 2018 version of qiime it might work so, following link's commands installing with pip, in qiime 2018.8, python 3.5.5, I get the following error:

(qiime2-20188) [larteag7@apolo workdir-feb2021] pip install --user scnic  
Collecting scnic  
Collecting networkx\>=2 (from scnic)  
Using cached [https://files.pythonhosted.org/packages/41/8f/dd6a8e85946def36e4f2c69c84219af0fa5e832b018c970e92f2ad337e45/networkx-2.4-py3-none-any.whl](https://files.pythonhosted.org/packages/41/8f/dd6a8e85946def36e4f2c69c84219af0fa5e832b018c970e92f2ad337e45/networkx-2.4-py3-none-any.whl)  
Installing collected packages: networkx, scnic  
Successfully installed networkx-2.4 scnic-0.6.2  
(qiime2-20188) [larteag7@apolo workdir-feb2021] pip install git+https://github.com/lozuponelab/q2-SCNIC.git  
Collecting git+https://github.com/lozuponelab/q2-SCNIC.git  
Cloning [GitHub - lozuponelab/q2-SCNIC: A QIIME2 plugin for running SCNIC](https://github.com/lozuponelab/q2-SCNIC.git) to /tmp/pip-req-build-ed9vwtrj  
Requirement already satisfied (use --upgrade to upgrade): q2-SCNIC==2020.10+4.gf8566e7 from git+https://github.com/lozuponelab/q2-SCNIC.git in /home/larteag7/.conda/envs/qiime2-20188/lib/python3.5/site-packages  
Building wheels for collected packages: q2-SCNIC  
Running setup.py bdist\_wheel for q2-SCNIC ... done  
Stored in directory: /tmp/pip-ephem-wheel-cache-4ufgz68z/wheels/ad/4f/90/efd772f34ca8f61d2990b841f051aaf9ecdb816e01512ae3a1  
Successfully built q2-SCNIC  
(qiime2-20188) [larteag7@apolo workdir-feb2021]$ qiime dev refresh-cache

QIIME is caching your current deployment for improved performance. This may take a few moments and should only happen once per deployment.  
Traceback (most recent call last):  
File "/home/larteag7/.conda/envs/qiime2-20188/bin/qiime", line 11, in   
sys.exit(qiime())  
File "/home/larteag7/.conda/envs/qiime2-20188/lib/python3.5/site-packages/click/core.py", line 722, in **call**  
return self.main(\*args, \*\*kwargs)  
File "/home/larteag7/.conda/envs/qiime2-20188/lib/python3.5/site-packages/click/core.py", line 697, in main  
rv = self.invoke(ctx)  
File "/home/larteag7/.conda/envs/qiime2-20188/lib/python3.5/site-packages/click/core.py", line 1066, in invoke  
return \_process\_result(sub\_ctx.command.invoke(sub\_ctx))  
File "/home/larteag7/.conda/envs/qiime2-20188/lib/python3.5/site-packages/click/core.py", line 1066, in invoke  
return \_process\_result(sub\_ctx.command.invoke(sub\_ctx))  
File "/home/larteag7/.conda/envs/qiime2-20188/lib/python3.5/site-packages/click/core.py", line 895, in invoke  
return ctx.invoke(self.callback, \*\*ctx.params)  
File "/home/larteag7/.conda/envs/qiime2-20188/lib/python3.5/site-packages/click/core.py", line 535, in invoke  
return callback(\*args, \*\*kwargs)  
File "/home/larteag7/.conda/envs/qiime2-20188/lib/python3.5/site-packages/q2cli/dev.py", line 27, in refresh\_cache  
import q2cli.cache  
File "/home/larteag7/.conda/envs/qiime2-20188/lib/python3.5/site-packages/q2cli/cache.py", line 301, in   
CACHE = DeploymentCache()  
File "/home/larteag7/.conda/envs/qiime2-20188/lib/python3.5/site-packages/q2cli/cache.py", line 61, in **init**  
self.\_state = self.\_get\_cached\_state(refresh=refresh)  
File "/home/larteag7/.conda/envs/qiime2-20188/lib/python3.5/site-packages/q2cli/cache.py", line 107, in \_get\_cached\_state  
self.\_cache\_current\_state(current\_requirements)  
File "/home/larteag7/.conda/envs/qiime2-20188/lib/python3.5/site-packages/q2cli/cache.py", line 200, in \_cache\_current\_state  
state = self.\_get\_current\_state()  
File "/home/larteag7/.conda/envs/qiime2-20188/lib/python3.5/site-packages/q2cli/cache.py", line 238, in \_get\_current\_state  
plugin\_manager = qiime2.sdk.PluginManager()  
File "/home/larteag7/.conda/envs/qiime2-20188/lib/python3.5/site-packages/qiime2/sdk/plugin\_manager.py", line 44, in **new**  
self.\_init()  
File "/home/larteag7/.conda/envs/qiime2-20188/lib/python3.5/site-packages/qiime2/sdk/plugin\_manager.py", line 59, in \_init  
plugin = entry\_point.load()  
File "/home/larteag7/.conda/envs/qiime2-20188/lib/python3.5/site-packages/pkg\_resources/ **init**.py", line 2325, in load  
return self.resolve()  
File "/home/larteag7/.conda/envs/qiime2-20188/lib/python3.5/site-packages/pkg\_resources/ **init**.py", line 2331, in resolve  
module = **import** (self.module\_name, fromlist=[' **name**'], level=0)  
File "/home/larteag7/.conda/envs/qiime2-20188/lib/python3.5/site-packages/q2\_SCNIC/plugin\_setup.py", line 7, in   
from q2\_SCNIC.\_format import GraphModelingLanguageFormat, GraphModelingLanguageDirectoryFormat, PairwiseFeatureDataFormat,   
File "/home/larteag7/.conda/envs/qiime2-20188/lib/python3.5/site-packages/q2\_SCNIC/\_format.py", line 3, in   
import networkx as nx  
ImportError: No module named 'networkx'

Let me know what you think,  
Luis.

---

<div class="post-metadata">

### Author: ![timanix](https://forum.qiime2.org/user_avatar/forum.qiime2.org/timanix/32/17879_2.png) [@timanix](https://forum.qiime2.org/u/timanix)
#### Post date: [July 21, 2021, 2:19pm UTC](https://forum.qiime2.org/t/about-q2-scnic-installation/20245/4 "2021-07-21T14:19:36Z")

</div>

Hi!  
I collected all above mentioned errors while trying to work with SCNIC or q2-SCNIC.  
The problem is that 'to\_dense' function was deprecated in version 1.0, so you need to downgrade to pandas 0.25

Do not use conda to downgrade since it will mess with dependencies.  
For me worked:  
`pip install pandas==0.25`

PS. Do not forget to upgrade pandas back to previous version since you may encounter some errors in other plugins,or install a separate qiime2 version that will be used only for SCNIC

---

<div class="post-metadata">

### Author: ![WeedCentipede](https://forum.qiime2.org/user_avatar/forum.qiime2.org/weedcentipede/32/10549_2.png) [@WeedCentipede](https://forum.qiime2.org/u/WeedCentipede)
#### Post date: [July 22, 2021, 8:40pm UTC](https://forum.qiime2.org/t/about-q2-scnic-installation/20245/5 "2021-07-22T20:40:15Z")

</div>

Hi Timur,

Sorry for the late answer!  
It worked, then it failed due to fastspar but after a conda installation (following cmd)

> conda install -c bioconda -c conda-forge --override-channels fastspar

I was finally able to run scnic,  
Thank you so much,  
Cheers,

---

<div class="post-metadata">

### Author: ![cherman2](https://forum.qiime2.org/user_avatar/forum.qiime2.org/cherman2/32/17129_2.png) [@cherman2](https://forum.qiime2.org/u/cherman2)
#### Post date: [July 26, 2023, 4:51pm UTC](https://forum.qiime2.org/t/about-q2-scnic-installation/20245/6 "2023-07-26T16:51:52Z")

</div>

2 off-topic replies have been split into a new topic: [q2-scnic not compatible with 2023.5 feature table](https://forum.qiime2.org/t/q2-scnic-not-compatible-with-2023-5-feature-table/27212)

Please keep replies on-topic in the future.
