Issue with Rcpp and DADA2

UPDATE:
I can no longer respond to this thread but thought I'd update here! I was able to fix the problem by completely uninstalling Rstudio and R and then creating a new conda environment with the latest version of R! hope this helps anyone in the future!

Hi There,
I've seen this question on the forum before, and none of the answers seem to address the same situation I'm in.

Every time I run dada2, I get this error:

Plugin error from dada2:

  An error was encountered while running DADA2 in R (return code 1), please inspect stdout and stderr to learn more.

Debug info has been saved to /var/folders/vq/myv7llhj7sdgmwrn1tt316br0000gn/T/qiime2-q2cli-err-phg0be4f.log

The log says this:

command: run_dada_paired.R /var/folders/vq/myv7llhj7sdgmwrn1tt316br0000gn/T/tmphfd5i8ov/forward /var/folders/vq/myv7llhj7sdgmwrn1tt316br0000gn/T/tmphfd5i8ov/reverse /var/folders/vq/myv7llhj7sdgmwrn1tt316br0000gn/T/tmphfd5i8ov/output.tsv.biom /var/folders/vq/myv7llhj7sdgmwrn1tt316br0000gn/T/tmphfd5i8ov/track.tsv /var/folders/vq/myv7llhj7sdgmwrn1tt316br0000gn/T/tmphfd5i8ov/filt_f /var/folders/vq/myv7llhj7sdgmwrn1tt316br0000gn/T/tmphfd5i8ov/filt_r 200 200 25 25 2.0 2.0 2 12 independent consensus 1.0 0 1000

R version 4.1.1 (2021-08-10) 
Loading required package: Rcpp
Error: package or namespace load failed for ‘Rcpp’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/lib/R/library/Rcpp/libs/Rcpp.so':
  dlopen(/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/lib/R/library/Rcpp/libs/Rcpp.so, 6): Library not loaded: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib
  Referenced from: /usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/lib/R/library/Rcpp/libs/Rcpp.so
  Reason: image not found
Error: package ‘Rcpp’ could not be loaded
Execution halted
Traceback (most recent call last):
  File "/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 266, in denoise_paired
    run_commands([cmd])
  File "/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 36, in run_commands
    subprocess.run(cmd, check=True)
  File "/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['run_dada_paired.R', '/var/folders/vq/myv7llhj7sdgmwrn1tt316br0000gn/T/tmphfd5i8ov/forward', '/var/folders/vq/myv7llhj7sdgmwrn1tt316br0000gn/T/tmphfd5i8ov/reverse', '/var/folders/vq/myv7llhj7sdgmwrn1tt316br0000gn/T/tmphfd5i8ov/output.tsv.biom', '/var/folders/vq/myv7llhj7sdgmwrn1tt316br0000gn/T/tmphfd5i8ov/track.tsv', '/var/folders/vq/myv7llhj7sdgmwrn1tt316br0000gn/T/tmphfd5i8ov/filt_f', '/var/folders/vq/myv7llhj7sdgmwrn1tt316br0000gn/T/tmphfd5i8ov/filt_r', '200', '200', '25', '25', '2.0', '2.0', '2', '12', 'independent', 'consensus', '1.0', '0', '1000']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/lib/python3.8/site-packages/q2cli/commands.py", line 329, in __call__
    results = action(**arguments)
  File "<decorator-gen-514>", line 2, in denoise_paired
  File "/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/lib/python3.8/site-packages/qiime2/sdk/action.py", line 244, in bound_callable
    outputs = self._callable_executor_(scope, callable_args,
  File "/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/lib/python3.8/site-packages/qiime2/sdk/action.py", line 390, in _callable_executor_
    output_views = self._callable(**view_args)
  File "/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 279, in denoise_paired
    raise Exception("An error was encountered while running DADA2"
Exception: An error was encountered while running DADA2 in R (return code 1), please inspect stdout and stderr to learn more.

and just for more information, when I type env I get:

S=x86_64-apple-darwin13.4.0-as

LDFLAGS=-Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/lib -L/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/lib

AR=x86_64-apple-darwin13.4.0-ar

RSTUDIO_WHICH_R=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/bin/R

ac_cv_func_malloc_0_nonnull=yes

JAVA_LD_LIBRARY_PATH=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/lib/server

TERM_PROGRAM=Apple_Terminal

ac_cv_func_realloc_0_nonnull=yes

OBJC=x86_64-apple-darwin13.4.0-clang

HOST=x86_64-apple-darwin13.4.0

SHELL=/bin/bash

TERM=xterm-256color

NM=x86_64-apple-darwin13.4.0-nm

PYTHONNOUSERSITE=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/lib/python*/site-packages/

CPPFLAGS=-D_FORTIFY_SOURCE=2 -isystem /usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/include

TMPDIR=/var/folders/vq/myv7llhj7sdgmwrn1tt316br0000gn/T/

PAGESTUFF=x86_64-apple-darwin13.4.0-pagestuff

CONDA_SHLVL=3

LIPO=x86_64-apple-darwin13.4.0-lipo

CONDA_PROMPT_MODIFIER=(qiime2-2021.4)

TERM_PROGRAM_VERSION=433

SIZE=x86_64-apple-darwin13.4.0-size

NMEDIT=x86_64-apple-darwin13.4.0-nmedit

SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

OLDPWD=/

TERM_SESSION_ID=256664C4-064C-4825-B026-A9AA8B2FE139

CXX_FOR_BUILD=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/bin/x86_64-apple-darwin13.4.0-clang++

INSTALL_NAME_TOOL=x86_64-apple-darwin13.4.0-install_name_tool

SEGEDIT=x86_64-apple-darwin13.4.0-segedit

GFORTRAN=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/bin/x86_64-apple-darwin13.4.0-gfortran

SEG_HACK=x86_64-apple-darwin13.4.0-seg_hack

USER=clairewilliams

CLANGXX=x86_64-apple-darwin13.4.0-clang++

LIBTOOL=x86_64-apple-darwin13.4.0-libtool

CONDA_TOOLCHAIN_BUILD=x86_64-apple-darwin13.4.0

FC_FOR_BUILD=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/bin/-gfortran

CONDA_EXE=/usr/local/Caskroom/miniconda/base/bin/conda

OTOOL=x86_64-apple-darwin13.4.0-otool

SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.1XBSJPCMdq/Listeners

DEBUG_FORTRANFLAGS=-march=core2 -mtune=haswell -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -isystem /usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/include -march=core2 -mtune=haswell -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -Og -g -Wall -Wextra -fcheck=all -fbacktrace -fimplicit-none -fvar-tracking-assignments

CXXFLAGS=-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -std=c++14 -fmessage-length=0 -isystem /usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/include

STRINGS=x86_64-apple-darwin13.4.0-strings

CONDA_TOOLCHAIN_HOST=x86_64-apple-darwin13.4.0

_CE_CONDA=

CHECKSYMS=x86_64-apple-darwin13.4.0-checksyms

CONDA_PREFIX_1=/Users/clairewilliams/opt/miniconda2

PATH=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/bin:/usr/local/Caskroom/miniconda/base/bin:/Users/clairewilliams/opt/miniconda2/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Mono.framework/Versions/Current/Commands

MESON_ARGS=--buildtype release

CONDA_PREFIX_2=/usr/local/Caskroom/miniconda/base

DEBUG_CXXFLAGS=-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -std=c++14 -fmessage-length=0 -Og -g -Wall -Wextra -isystem /usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/include

BUILD=x86_64-apple-darwin13.4.0

LD=x86_64-apple-darwin13.4.0-ld

CONDA_PREFIX=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4

F90=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/bin/x86_64-apple-darwin13.4.0-gfortran

PWD=/Users/clairewilliams

JAVA_HOME=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4

STRIP=x86_64-apple-darwin13.4.0-strip

CMAKE_ARGS=-DCMAKE_AR=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/bin/x86_64-apple-darwin13.4.0-ar -DCMAKE_CXX_COMPILER_AR=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/bin/x86_64-apple-darwin13.4.0-ar -DCMAKE_C_COMPILER_AR=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/bin/x86_64-apple-darwin13.4.0-ar -DCMAKE_RANLIB=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/bin/x86_64-apple-darwin13.4.0-ranlib -DCMAKE_CXX_COMPILER_RANLIB=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/bin/x86_64-apple-darwin13.4.0-ranlib -DCMAKE_C_COMPILER_RANLIB=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/bin/x86_64-apple-darwin13.4.0-ranlib -DCMAKE_LINKER=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/bin/x86_64-apple-darwin13.4.0-ld -DCMAKE_STRIP=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/bin/x86_64-apple-darwin13.4.0-strip -DCMAKE_INSTALL_NAME_TOOL=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/bin/x86_64-apple-darwin13.4.0-install_name_tool -DCMAKE_LIBTOOL=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/bin/x86_64-apple-darwin13.4.0-libtool -DCMAKE_OSX_DEPLOYMENT_TARGET= -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

MPLBACKEND=Agg

F95=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/bin/x86_64-apple-darwin13.4.0-gfortran

LANG=en_US.UTF-8

DEBUG_FFLAGS=-march=core2 -mtune=haswell -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -isystem /usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/include -march=core2 -mtune=haswell -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -Og -g -Wall -Wextra -fcheck=all -fbacktrace -fimplicit-none -fvar-tracking-assignments

XPC_FLAGS=0x0

F77=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/bin/x86_64-apple-darwin13.4.0-gfortran

REDO_PREBINDING=x86_64-apple-darwin13.4.0-redo_prebinding

CXX=x86_64-apple-darwin13.4.0-clang++

CC_FOR_BUILD=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/bin/x86_64-apple-darwin13.4.0-clang

CLANG=x86_64-apple-darwin13.4.0-clang

_CE_M=

XPC_SERVICE_NAME=0

SHLVL=1

HOME=/Users/clairewilliams

FORTRANFLAGS=-march=core2 -mtune=haswell -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -isystem /usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/include

CFLAGS=-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/include

_CONDA_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_x86_64_apple_darwin13_4_0

FC=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/bin/x86_64-apple-darwin13.4.0-gfortran

CONDA_PYTHON_EXE=/usr/local/Caskroom/miniconda/base/bin/python

LOGNAME=clairewilliams

build_alias=x86_64-apple-darwin13.4.0

JAVA_HOME_CONDA_BACKUP=

CONDA_DEFAULT_ENV=qiime2-2021.4

DEBUG_CFLAGS=-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -Og -g -Wall -Wextra -isystem /usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/include

RANLIB=x86_64-apple-darwin13.4.0-ranlib

CMAKE_PREFIX_PATH=:/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4

CC=x86_64-apple-darwin13.4.0-clang

SEG_ADDR_TABLE=x86_64-apple-darwin13.4.0-seg_addr_table

host_alias=x86_64-apple-darwin13.4.0

JAVA_LD_LIBRARY_PATH_BACKUP=

LDFLAGS_LD=-pie -headerpad_max_install_names -dead_strip_dylibs -rpath /usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/lib -L/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/lib

R_LIBS_USER=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/lib/R/library/

OBJC_FOR_BUILD=/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/bin/x86_64-apple-darwin13.4.0-clang

FFLAGS=-march=core2 -mtune=haswell -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -isystem /usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/include

_=/usr/bin/env

Any help you can provide would be greatly appreciated! Thanks so much!
Best,
Claire

@clairewill22,

Based on your log, it looks like you have at least 3 versions of Rlang on your machine, 4.1.1, which is a more recent release than is in the qiime2-2021.4 release, 4.0.3 from qiime2-2021.4, and a some local 4.0.x install.

Thanks for posting the output from env, as far as I can tell everything from there looks good! However, R has some of its own path stuff that it does, especially with Rstudio installed. Would you mind running these two commands and posting the output:

  • R -e ".libPaths()"
  • cat ~/.Rprofile

It looks like R is trying to load Rcpp from the local library, /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib, instead of from your conda environment. Hopefully we can get it wired up correctly for you soon.

As an aside, when posting the output from env, it is good to check to make sure you are not disclosing any PID if you don't mean to. In this case the only thing I saw was your user account name, but it is something to keep in mind. I also say this as a bit of a PSA incase someone else sees that it was helpful for you to post this and then they go ahead and do it without knowing that that could be a consequence of posting the raw env output.

1 Like

Hi @Keegan-Evans,
Thanks for the PSA! I did check for personal information - but maybe I missed something.

So when I run

I get

R -e ".libPaths()"

R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out"

Copyright (C) 2020 The R Foundation for Statistical Computing

Platform: x86_64-apple-darwin13.4.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.

You are welcome to redistribute it under certain conditions.

Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.

Type 'contributors()' for more information and

'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or

'help.start()' for an HTML browser interface to help.

Type 'q()' to quit R.

> .libPaths()

[1] "/usr/local/Caskroom/miniconda/base/envs/qiime2-2021.4/lib/R/library"

And when I run

I get

cat: /Users/clairewill/.Rprofile: No such file or directory

Thanks a mil!
Best,
Claire

@clairewill22,

Oh man, I expected to see a mess when you printed the output of those commands, but those look good.

Did you change anything about your R or Rstudio installation between when you tried to run q2-dada2 and the commands I posted?

If not, it seems like you might have some other factor going on with your machine. As a final check you could make sure your QIIME 2 conda environment is activated and run which R, which should return only a path found in your .../miniconda/base/envs/qiime2-2021.4/ path. If it isn't, it would require taking whatever steps necessary to remove other paths.

Sorry I don't have a better answer than that at this point, but it does look like it has to do with some other configuration on your machine. If you have Rstudio, you might try uninstalling it. In previous releases of QIIME 2 we included instructions to NOT install Rstudio because there was such a high likelyhood of it creating problems similar to this.

No worries! Thanks so much for your advice. Yeah what "which R" returns seems right on track, so I'm going to try to uninstall R Studio and R and see how that shakes out. I'll report back here if there is a resolution.

Kind Regards,
Claire

1 Like

@clairewill22,

Sounds good, if that doesn't work, it would also be worth trying a complete uninstall/restart/install of QIIME 2 as well. But I suspect just removing Rstudio/non-conda R versions will do the trick.

Also, if you still want to have them available, you can create a separate conda environment and conda install them in it!

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