我在ubuntu 14.04下使用python 3.4.3并希望使用调用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代码?
答案 0 :(得分:0)
要求
目前,开发是在类UNIX操作上完成的 具有以下软件版本的系统。那些是 使用。
运行rpy2的推荐版本
- Python 3.5,与2.7和>的兼容性3.3