conda-forge.github.io: rpy2 installation linking problems

I was having problems that I couldn’t diagnose, so I deleted all of miniconda/.jupyter/etc, and reinstalled.

The error

import rpy2
%load_ext rpy2.ipython
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-3-a69f80d0128e> in <module>()
----> 1 get_ipython().magic('load_ext rpy2.ipython')

/Users/jonathan/miniconda3/envs/problem/lib/python3.4/site-packages/IPython/core/interactiveshell.py in magic(self, arg_s)
   2161         magic_name, _, magic_arg_s = arg_s.partition(' ')
   2162         magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2163         return self.run_line_magic(magic_name, magic_arg_s)
   2164
   2165     #-------------------------------------------------------------------------

/Users/jonathan/miniconda3/envs/problem/lib/python3.4/site-packages/IPython/core/interactiveshell.py in run_line_magic(self, magic_name, line)
   2082                 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
   2083             with self.builtin_trap:
-> 2084                 result = fn(*args,**kwargs)
   2085             return result
   2086

<decorator-gen-64> in load_ext(self, module_str)

/Users/jonathan/miniconda3/envs/problem/lib/python3.4/site-packages/IPython/core/magic.py in <lambda>(f, *a, **k)
    191     # but it's overkill for just that one bit of state.
    192     def magic_deco(arg):
--> 193         call = lambda f, *a, **k: f(*a, **k)
    194
    195         if callable(arg):

/Users/jonathan/miniconda3/envs/problem/lib/python3.4/site-packages/IPython/core/magics/extension.py in load_ext(self, module_str)
     64         if not module_str:
     65             raise UsageError('Missing module name.')
---> 66         res = self.shell.extension_manager.load_extension(module_str)
     67
     68         if res == 'already loaded':

/Users/jonathan/miniconda3/envs/problem/lib/python3.4/site-packages/IPython/core/extensions.py in load_extension(self, module_str)
     82             if module_str not in sys.modules:
     83                 with prepended_to_syspath(self.ipython_extension_dir):
---> 84                     __import__(module_str)
     85             mod = sys.modules[module_str]
     86             if self._call_load_ipython_extension(mod):

/Users/jonathan/miniconda3/envs/problem/lib/python3.4/site-packages/rpy2/ipython/__init__.py in <module>()
----> 1 from .rmagic import load_ipython_extension

/Users/jonathan/miniconda3/envs/problem/lib/python3.4/site-packages/rpy2/ipython/rmagic.py in <module>()
     50 # numpy and rpy2 imports
     51
---> 52 import rpy2.rinterface as ri
     53 import rpy2.robjects as ro
     54 import rpy2.robjects.packages as rpacks

/Users/jonathan/miniconda3/envs/problem/lib/python3.4/site-packages/rpy2/rinterface/__init__.py in <module>()
     90 del(os)
     91
---> 92 from rpy2.rinterface._rinterface import (baseenv,
     93                                          emptyenv,
     94                                          endr,

ImportError: dlopen(/Users/jonathan/miniconda3/envs/problem/lib/python3.4/site-packages/rpy2/rinterface/_rinterface.so, 2): Library not loaded: @rpath/libicuuc.54.dylib
  Referenced from: /Users/jonathan/miniconda3/envs/problem/lib/python3.4/site-packages/rpy2/rinterface/_rinterface.so
  Reason: image not found

How I installed everything

These were the steps that I ran:

conda update conda
conda config --add channels conda-forge
packages='ipywidgets
jupyter
jupyter_contrib_nbextensions
jupyter_nbextensions_configurator
matplotlib
mkl
mpld3
notebook
numpy
pandas
pip
pymc
pyparsing
scikit-learn
scipy
seaborn
statsmodels
'
conda create --name rpy3 -c r r r-irkernel r-recommended r-essentials rpy2 python=3 $packages -y
source activate rpy3
jupyter notebook

My setup

$ cat .condarc
channels:
  - conda-forge
  - defaults
anaconda_upload: true

And

$ conda info -a
Current conda install:

             platform : osx-64
        conda version : 4.1.11
    conda-env version : 2.5.2
  conda-build version : not installed
       python version : 3.5.2.final.0
     requests version : 2.10.0
     root environment : /Users/jonathan/miniconda3  (writable)
  default environment : /Users/jonathan/miniconda3
     envs directories : /Users/jonathan/miniconda3/envs
        package cache : /Users/jonathan/miniconda3/pkgs
         channel URLs : https://conda.anaconda.org/conda-forge/osx-64/
                        https://conda.anaconda.org/conda-forge/noarch/
                        https://repo.continuum.io/pkgs/free/osx-64/
                        https://repo.continuum.io/pkgs/free/noarch/
                        https://repo.continuum.io/pkgs/pro/osx-64/
                        https://repo.continuum.io/pkgs/pro/noarch/
          config file : /Users/jonathan/.condarc
         offline mode : False
    is foreign system : False

# conda environments:
#
rpy3                     /Users/jonathan/miniconda3/envs/rpy3
root                  *  /Users/jonathan/miniconda3

sys.version: 3.5.2 |Continuum Analytics, Inc.| (defau...
sys.prefix: /Users/jonathan/miniconda3
sys.executable: /Users/jonathan/miniconda3/bin/python
conda location: /Users/jonathan/miniconda3/lib/python3.5/site-packages/conda
conda-build: None
conda-env: /Users/jonathan/miniconda3/bin/conda-env
user site dirs: ~/.local/lib/python3.5

CIO_TEST: <not set>
CONDA_DEFAULT_ENV: <not set>
CONDA_ENVS_PATH: <not set>
DYLD_LIBRARY_PATH: <not set>
PATH: /Users/jonathan/miniconda3/bin:/Users/jonathan/miniconda3/bin:/Library/Frameworks/Python.framework/Versions/Current/bin:/Users/jonathan/Library/Haskell/bin:/Library/Frameworks/Python.framework/Versions/Current/bin:/Users/jonathan/github/whelper:/Users/jonathan/github/fitcmp:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin:/Users/jonathan/Dropbox/scripts:/Users/jonathan/Dropbox/scripts/bash:/Users/jonathan/bin:/Users/jonathan/github/AstroTools
PYTHONHOME: <not set>
PYTHONPATH: /Users/jonathan/github/CaliCompari/Python:/Users/jwhitmore/github/linfit:/Library/Frameworks/Python.framework/Versions/Current/bin/python:/Library/Frameworks/Python.framework/Versions/Current/lib:/Library/Frameworks/Python.framework/Versions/Current/bin/python:/Users/jonathan/github/AstroTools:

WARNING: could not import _license.show_info
# try:
# $ conda install -n root _license

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 33 (13 by maintainers)

Most upvoted comments

I’m having this same issue, and I agree with the following from above:

but to mark the issue as closed seems incorrect. It may be unsolvable, but this issue is a real one. People who have added the conda-forge channel will have otherwise working installs broken (in a really hard to diagnose way).

As far as I can tell, if a user needs rpy2, and anything in conda-forge, this issue occurs. rpy2 is an essential part of the Python data stack for many. This problem means that I can’t use conda at all for my current project, which seems to be a serious issue.

I’m happy to provide more information if needed on my specific case. But I think ignoring this issue outright is biting a lot of folks using conda for science.

IMHO there should be a bug called “conda defaults and conda-forge are incompatible” and all these things should be marked as duplicates of that and then closed.

As someone who works on r and defaults (pedantically r is a part of defaults now) as well as on conda-forge, I would like to know what is missing from r \ defaults that prevents you being able to use them.

I want all the options to be viable basically (and mixable in future).

I want all the options to be viable basically (and mixable in future).

For mixing conda-forge and defaults, one issue is that defaults is using a broken gettext version when compiling r-base. gettext=0.19.8 accidentally bumped the soversion and this was reverted in gettext=0.19.8.1. conda-forge is using 0.19.8.1 while defaults is using 0.19.8

Thanks for the help! Removing conda-forge from my channels in my ~/.condarc and then running conda install -c r r-base worked.

I’m finding that conda can be tricky to use: there’s always the pitfall of installing the ‘wrong’ version of a package, and then it can be hard to change the package version (e.g., having to manually remove a channel from ~/.condarc). Still, for most bioinformatics software, conda (& especially bioconda) makes installation extremely simple.

You need to remove conda-forge from your channels list in ~/.condarc then do conda update all, or just conda install -c r r-base to install what you need.

You should use conda search -c r r-base for the search you are attempting (though this does look like you’ve run into a bug in anaconda-client).

FYI there is an effort underway to add R to conda-forge, but may take a bit of time to complete.