Macbook上的rpy2-2.8.5图像未找到错误

时间:2017-05-11 22:09:33

标签: python jupyter rpy2

当我使用%load_ext rpy2.ipython在Jupyter Notebook中加载rpy2时,我收到此错误消息。

我在macbook El Capitan上使用python 3.5.3(来自官方网站,而不是来自anaconda)。 Rpy2通过pip3安装。

我还尝试在python3控制台中导入rpy2。 '导入rpy2'没有抱怨,但导入rpy2.ipython'或者'导入rpy2.robjects'给了我相同的图像没找到错误。

任何人都知道如何解决这个问题?

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-3-6344af05b9f0> in <module>()
----> 1 get_ipython().magic('load_ext rpy2.ipython')
      2 #this doesn't work now, somehow
      3 #f**k

/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/IPython/core/interactiveshell.py in magic(self, arg_s)
   2128         magic_name, _, magic_arg_s = arg_s.partition(' ')
   2129         magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2130         return self.run_line_magic(magic_name, magic_arg_s)
   2131 
   2132     #-------------------------------------------------------------------------

/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/IPython/core/interactiveshell.py in run_line_magic(self, magic_name, line)
   2049                 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
   2050             with self.builtin_trap:
-> 2051                 result = fn(*args,**kwargs)
   2052             return result
   2053 

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

/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/IPython/core/magic.py in <lambda>(f, *a, **k)
    186     # but it's overkill for just that one bit of state.
    187     def magic_deco(arg):
--> 188         call = lambda f, *a, **k: f(*a, **k)
    189 
    190         if callable(arg):

/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/IPython/core/magics/extension.py in load_ext(self, module_str)
     34         if not module_str:
     35             raise UsageError('Missing module name.')
---> 36         res = self.shell.extension_manager.load_extension(module_str)
     37 
     38         if res == 'already loaded':

/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/IPython/core/extensions.py in load_extension(self, module_str)
     85             if module_str not in sys.modules:
     86                 with prepended_to_syspath(self.ipython_extension_dir):
---> 87                     mod = import_module(module_str)
     88                     if mod.__file__.startswith(self.ipython_extension_dir):
     89                         print(("Loading extensions from {dir} is deprecated. "

/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/importlib/__init__.py in import_module(name, package)
    124                 break
    125             level += 1
--> 126     return _bootstrap._gcd_import(name[level:], package, level)
    127 
    128 

/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/importlib/_bootstrap.py in _gcd_import(name, package, level)

/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/importlib/_bootstrap.py in _find_and_load(name, import_)

/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)

/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/importlib/_bootstrap.py in _load_unlocked(spec)

/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/importlib/_bootstrap_external.py in exec_module(self, module)

/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)

/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/rpy2/ipython/__init__.py in <module>()
----> 1 from .rmagic import load_ipython_extension

/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/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

/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/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(/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/rpy2/rinterface/_rinterface.cpython-35m-darwin.so, 2): Library not loaded: @rpath/libpcre.1.dylib
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/rpy2/rinterface/_rinterface.cpython-35m-darwin.so
  Reason: image not found

0 个答案:

没有答案