Rpy2 isn't loading properly for my repository

I’ve had to not use rpy2 because it’s breaking the build. I’m going to re-enable if anyone can look and see what’s going on.

Collecting rpy2
Downloading rpy2-3.3.5.tar.gz (174 kB)
ERROR: Command errored out with exit status 1:
command: /srv/conda/envs/notebook/bin/python3.7 -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-4kxlfowb/rpy2/setup.py’"’"’; file=’"’"’/tmp/pip-install-4kxlfowb/rpy2/setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ egg_info --egg-base /tmp/pip-pip-egg-info-a_mqrvt1
cwd: /tmp/pip-install-4kxlfowb/rpy2/
Complete output (2 lines):
cffi mode: CFFI_MODE.ANY
Error: rpy2 in API mode cannot be built without R in the PATH or R_HOME defined. Correct this or force ABI mode-only by defining the environment variable RPY2_CFFI_MODE=ABI
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Removing intermediate container 00fb7e465f0c
The command ‘/bin/sh -c ${KERNEL_PYTHON_PREFIX}/bin/pip install --no-cache-dir -r “requirements.txt”’ returned a non-zero code: 1

rpy2 needs R installed and so you can add a runtime.txt configuration file as discussed here to trigger installing R during the build.
Then the build will work again, as you can see by using the updated launch binder badge at my fork here.

2 Likes