安装 rpy2 中的问题,安装rpy2问题


参考:

1、https://github.com/cqcn1991/Wind-Speed-Analysis 的Redme.md


python3中  jupyter notebook中rpy2的安装:


1、先安装R和RStudio

2、安装 rpy2  参考:https://stackoverflow.com/questions/14882477/rpy2-install-on-windows-7

  1)    https://www.lfd.uci.edu/~gohlke/pythonlibs/#rpy2  这个网址中下载rpy2的whl包

  2)   通过pip install  xxx安装这个包,

  3)    python 中通过 import rpy2和  import rpy2.robjects as robjects 检查是否安装成功


3、安装后出现的问题的解决办法 参考:https://stackoverflow.com/questions/24414540/rpy2-error-wac-a-mole-r-user-not-defined

    主要是要添加R_HOME 和R_USER的环境变量

4、jupyter notebook 中运行

      %load_ext rpy2.ipython
报错:AttributeError: 'ZMQInteractiveShell' object has no attribute 'has_readline'




找了很多资料找不到原因,最后是通过conda install rpy2  重新安装rpy2得以解决,可能是我之前安装的pip install whl版本不对












查看评论

相关内容

    暂无相关文章