簡體   English   中英

Python3-使用/包裝R函數

[英]Python3 - use/wrap R function

我在ubuntu 14.04下使用python 3.4.3,並且想使用call R代碼獲得一些結果。 我知道有一些軟件包,例如pyper和rpy2,但它們看起來僅與python2兼容。 通過輸入“ sudo pip3 install rpy2”,我得到以下信息

Exception information:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 283, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/usr/lib/python3/dist-packages/pip/req.py", line 1436, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/pip/req.py", line 707, in install
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
  File "/usr/lib/python3/dist-packages/pip/util.py", line 715, in call_subprocess
    % (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip_build_user/rpy2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-8hhbkgev-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_user/rpy2

有什么辦法可以在python 3.4.3中使用R代碼嗎?

RPY其實兩者的Python 2和Python 3兼容。 http://rpy2.readthedocs.io/en/version_2.8.x/overview.html#requirements

要求

當前,開發是在具有以下軟件版本的類UNIX操作系統上進行的。 這些是與rpy2一起運行的推薦版本。

  • Python 3.5,預期與2.7和> 3.3兼容

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM