# Plugin error from diversity when using adonis plugin

**URL:** <https://forum.qiime2.org/t/plugin-error-from-diversity-when-using-adonis-plugin/23880>\
**Category:** Technical Support\
**Tags:** diversity, adonis\
**Created:** [August 12, 2022, 1:47pm UTC](https://forum.qiime2.org/t/plugin-error-from-diversity-when-using-adonis-plugin/23880 "2022-08-12T13:47:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pkmnsandy](https://forum.qiime2.org/user_avatar/forum.qiime2.org/pkmnsandy/32/12958_2.png) [@pkmnsandy](https://forum.qiime2.org/u/pkmnsandy)\
**Post date:** [August 12, 2022, 1:47pm UTC](https://forum.qiime2.org/t/plugin-error-from-diversity-when-using-adonis-plugin/23880/1 "2022-08-12T13:47:29Z")

</div>

Hi,  
I am trying to run PERMANOVA using the adonis plugin.

Here is my code:

```auto
qiime diversity adonis \
    --i-distance-matrix output/output/pmoA_deicode_distance_nobulk.qza \
    --m-metadata-file metadata/metadata.txt \
    --p-formula "genotype" \
    --o-visualization output/output/pmoA_permanova_nobulk.qzv

```

However, I always got this error code:

```auto
Running external command line application. This may print messages to stdout and/or stderr.
The command being run is below. This command cannot be manually re-run as it will depend on temporary files that no longer exist.

Command: run_adonis.R /var/folders/cj/8xt2ysm50wz8ww85tr7c1hfh0000gn/T/tmp5n_zhc4w/dm.tsv /var/folders/cj/8xt2ysm50wz8ww85tr7c1hfh0000gn/T/tmp5n_zhc4w/md.tsv genotype 999 1 /var/folders/cj/8xt2ysm50wz8ww85tr7c1hfh0000gn/T/qiime2-temp-q95efxwd/adonis.tsv

R version 4.1.3 (2022-03-10) 
Loading required package: permute
Loading required package: lattice
Error: package or namespace load failed for ‘lattice’ in library.dynam(lib, package, package.lib):
 shared object ‘lattice.so’ not found
Error: package ‘lattice’ could not be loaded
Execution halted
Traceback (most recent call last):
  File "/Users/pkmnsandy/opt/miniconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2cli/commands.py", line 339, in __call__
    results = action(**arguments)
  File "<decorator-gen-373>", line 2, in adonis
  File "/Users/pkmnsandy/opt/miniconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/qiime2/sdk/action.py", line 245, in bound_callable
    outputs = self._callable_executor_(scope, callable_args,
  File "/Users/pkmnsandy/opt/miniconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/qiime2/sdk/action.py", line 453, in _callable_executor_
    ret_val = self._callable(output_dir=temp_dir, **view_args)
  File "/Users/pkmnsandy/opt/miniconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2_diversity/_beta/_visualizer.py", line 382, in adonis
    _run_command(cmd)
  File "/Users/pkmnsandy/opt/miniconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2_diversity/_beta/_visualizer.py", line 408, in _run_command
    subprocess.run(cmd, check=True)
  File "/Users/pkmnsandy/opt/miniconda3/envs/qiime2-2022.2/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['run_adonis.R', '/var/folders/cj/8xt2ysm50wz8ww85tr7c1hfh0000gn/T/tmp5n_zhc4w/dm.tsv', '/var/folders/cj/8xt2ysm50wz8ww85tr7c1hfh0000gn/T/tmp5n_zhc4w/md.tsv', 'genotype', '999', '1', '/var/folders/cj/8xt2ysm50wz8ww85tr7c1hfh0000gn/T/qiime2-temp-q95efxwd/adonis.tsv']' returned non-zero exit status 1.

```

Also, I followed the solution suggested in this [post](https://forum.qiime2.org/t/adonis-plugin-unable-to-load-lattice/23581), but unfortunately, I was unable to install Qiime yet in my Mac mini.

Now, I am using this hard- and software:  
MacBook Pro 13 inch (2017) running macOS Monterey.

Any help and support would be highly appreciated and thank you so much.

Best,  
Sandy

---

<div class="post-metadata">

**Author:** ![Oddant1](https://forum.qiime2.org/user_avatar/forum.qiime2.org/oddant1/32/17130_2.png) [@Oddant1](https://forum.qiime2.org/u/Oddant1)\
**Post date:** [August 16, 2022, 9:11pm UTC](https://forum.qiime2.org/t/plugin-error-from-diversity-when-using-adonis-plugin/23880/2 "2022-08-16T21:11:05Z")

</div>

Hello @pkmnsandy, please let us know if reinstalling QIIME 2 solved the problem once you are able to get it reinstalled. Thank you.

---

<div class="post-metadata">

**Author:** ![Oddant1](https://forum.qiime2.org/user_avatar/forum.qiime2.org/oddant1/32/17130_2.png) [@Oddant1](https://forum.qiime2.org/u/Oddant1)\
**Post date:** [August 16, 2022, 9:11pm UTC](https://forum.qiime2.org/t/plugin-error-from-diversity-when-using-adonis-plugin/23880/3 "2022-08-16T21:11:09Z")

</div>



---

<div class="post-metadata">

**Author:** ![pkmnsandy](https://forum.qiime2.org/user_avatar/forum.qiime2.org/pkmnsandy/32/12958_2.png) [@pkmnsandy](https://forum.qiime2.org/u/pkmnsandy)\
**Post date:** [August 17, 2022, 7:04pm UTC](https://forum.qiime2.org/t/plugin-error-from-diversity-when-using-adonis-plugin/23880/4 "2022-08-17T19:04:57Z")

</div>

Hi, after the reinstall I try to run qiime diversity adonis. Unfortunately, I still get this error message.

```auto
Running external command line application. This may print messages to stdout and/or stderr.
The command being run is below. This command cannot be manually re-run as it will depend on temporary files that no longer exist.

Command: run_adonis.R /var/folders/zx/rys0b_8576z_gn4rt8klcrzh0000gn/T/tmp_x6fj8dj/dm.tsv /var/folders/zx/rys0b_8576z_gn4rt8klcrzh0000gn/T/tmp_x6fj8dj/md.tsv genotype*nitrogen*soil*compartment 999 1 /var/folders/zx/rys0b_8576z_gn4rt8klcrzh0000gn/T/qiime2-temp-mtazkwxj/adonis.tsv

R version 4.2.1 (2022-06-23) 
Loading required package: permute
Loading required package: lattice
Error: package or namespace load failed for ‘lattice’ in library.dynam(lib, package, package.lib):
 shared object ‘lattice.so’ not found
Error: package ‘lattice’ could not be loaded
Execution halted
Traceback (most recent call last):
  File "/Users/pkmnsandy/opt/miniconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2cli/commands.py", line 339, in __call__
    results = action(**arguments)
  File "<decorator-gen-114>", line 2, in adonis
  File "/Users/pkmnsandy/opt/miniconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/qiime2/sdk/action.py", line 245, in bound_callable
    outputs = self._callable_executor_(scope, callable_args,
  File "/Users/pkmnsandy/opt/miniconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/qiime2/sdk/action.py", line 453, in _callable_executor_
    ret_val = self._callable(output_dir=temp_dir, **view_args)
  File "/Users/pkmnsandy/opt/miniconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2_diversity/_beta/_visualizer.py", line 382, in adonis
    _run_command(cmd)
  File "/Users/pkmnsandy/opt/miniconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2_diversity/_beta/_visualizer.py", line 408, in _run_command
    subprocess.run(cmd, check=True)
  File "/Users/pkmnsandy/opt/miniconda3/envs/qiime2-2022.2/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['run_adonis.R', '/var/folders/zx/rys0b_8576z_gn4rt8klcrzh0000gn/T/tmp_x6fj8dj/dm.tsv', '/var/folders/zx/rys0b_8576z_gn4rt8klcrzh0000gn/T/tmp_x6fj8dj/md.tsv', 'genotype*nitrogen*soil*compartment', '999', '1', '/var/folders/zx/rys0b_8576z_gn4rt8klcrzh0000gn/T/qiime2-temp-mtazkwxj/adonis.tsv']' returned non-zero exit status 1.

```

---

<div class="post-metadata">

**Author:** ![Oddant1](https://forum.qiime2.org/user_avatar/forum.qiime2.org/oddant1/32/17130_2.png) [@Oddant1](https://forum.qiime2.org/u/Oddant1)\
**Post date:** [August 19, 2022, 11:38pm UTC](https://forum.qiime2.org/t/plugin-error-from-diversity-when-using-adonis-plugin/23880/5 "2022-08-19T23:38:50Z")

</div>

Hi @pkmnsandy, Do you have R installed elsewhere on your system? I ask because it says you're using R version 4.2.1, but QIIME 2 2022.2 uses R 4.1.3. It would appear as though some wires are crossed and QIIME 2 is trying to use the wrong version of R. Could you please type `which R` into the command line with your QIIME 2 environment active and also `echo $PATH` and provide the output of those two commands here?

---

<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:** [September 20, 2022, 5:39am UTC](https://forum.qiime2.org/t/plugin-error-from-diversity-when-using-adonis-plugin/23880/6 "2022-09-20T05:39:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Oddant1](https://forum.qiime2.org/user_avatar/forum.qiime2.org/oddant1/32/17130_2.png) [@Oddant1](https://forum.qiime2.org/u/Oddant1)\
**Post date:** [September 30, 2022, 6:20pm UTC](https://forum.qiime2.org/t/plugin-error-from-diversity-when-using-adonis-plugin/23880/7 "2022-09-30T18:20:30Z")

</div>


