2016-08-09 11 views
0

私はubuntu 14.04の下でPython 3.4.3を使用していますが、いくつかの結果を得るためにRコードを呼び出したいと思います。私はpyperやrpy2のようなパッケージの存在を知っていますが、Python2とのみ互換性があります。私は従うPython3 - Rを使用する/ R関数を使用する

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 

を得る「須藤PIP3がrpy2をインストールする」と入力し は、Python 3.4.3内部のRコードを使用する方法はありますか?

+0

あなたは[Cから* *ホイールとrpy2をインストールしようとしましたGohlkeのウェブサイト](http://www.lfd.uci.edu/~gohlke/pythonlibs/)?私は、Windows上でのインストールを実現するためのいくつかのトリックがあると思います。たとえば、http://stackoverflow.com/a/32983656/5050917を参照してください。 – mgc

答えて

0

RPYが、実際にはPython 2とPythonの両方と互換性のある3 http://rpy2.readthedocs.io/en/version_2.8.x/overview.html#requirements

Requirements

Currently the development is done on UNIX-like operating systems with the following software versions. Those are the recommended versions to run rpy2 with.

  • Python 3.5, with intended compatibility with 2.7 and > 3.3
+0

pip3のrpy2のインストール中にpipのインストールrpy2が動作するのはなぜですか? ファイル "/usr/lib/python3/dist-packages/pip/util.py"、715行目、call_subprocess %(command_desc、proc.returncode、cwd)) pip.exceptions.InstallationError:コマンド/ usr/bin "/ tmp/pip_build_user/rpy2/setup.py ';を実行してください(コンパイル(getattr、' open '、open)(__ file __)。 \ n "、" \ n "、__file__、 'exec'))" install --record /tmp/pip-8hhbkgev-record/install-record.txt --single-version-externalally-managed - コンパイル/ tmp/pip_build_user/rpy2のエラーコード1で失敗しました – user1403546

+0

'pip install rpy2'を使うとPython 3用にインストールされていませんか?パッケージがPython 2とPython 3の両方と互換性がある場合、両方のバージョンでpipインストールを使用するだけで十分な場合もあります。 – Jokab

+0

pip3を使わずに手動でバイナリをコンパイルしようとしましたか、またはプリコンパイルされたバイナリをダウンロードしましたか?私は別のパッケージで同様の問題を抱えていて、リポジトリに何か問題があったことが判明しました。大きなプロジェクトではあまり一般的ではありませんが、それは起こります。 – Synedraacus

関連する問題