安装rpy2但不会运行包

时间:2017-12-01 02:21:24

标签: r python-3.x anaconda conda rpy2

我已经能够通过conda安装rpy2:

conda install -c r rpy2  

然而,唯一有效的功能是:

import rpy2

我确认我在跑步: rpy v 2.9.0

3.5.2 | Anaconda custom(64位)| (默认,2016年7月5日,11:41:13)[MSC v.1900 64 bit(AMD64)]

Window 10

错误示例

from rpy2 import robjects

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-46-1f019d00d232> in <module>()
----> 1 from rpy2 import robjects

C:\Users\cfeld\AppData\Local\Continuum\Anaconda3\lib\site-packages\rpy2-2.9.0-py3.5-win-amd64.egg\rpy2\robjects\__init__.py in <module>()
     14 import itertools
     15 from datetime import datetime
---> 16 import rpy2.rinterface as rinterface
     17 import rpy2.rlike.container as rlc
     18 

C:\Users\cfeld\AppData\Local\Continuum\Anaconda3\lib\site-packages\rpy2-2.9.0-py3.5-win-amd64.egg\rpy2\rinterface\__init__.py in <module>()
     43 
     44 if sys.platform == 'win32':
---> 45     _load_r_dll(R_HOME)
     46 
     47 # cleanup the namespace

C:\Users\cfeld\AppData\Local\Continuum\Anaconda3\lib\site-packages\rpy2-2.9.0-py3.5-win-amd64.egg\rpy2\rinterface\__init__.py in _load_r_dll(r_home)
     27     if r_bin not in os.environ.get('PATH'):
     28         os.environ['PATH'] = ';'.join((os.environ.get('PATH'), r_bin, r_mod))
---> 29     ctypes.CDLL(r_dll)
     30 
     31 R_HOME = get_r_home()

C:\Users\cfeld\AppData\Local\Continuum\Anaconda3\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
    345 
    346         if handle is None:
--> 347             self._handle = _dlopen(self._name, mode)
    348         else:
    349             self._handle = handle

OSError: [WinError 126] The specified module could not be found

有什么建议吗?

0 个答案:

没有答案