8

私はこの問題を抱えています:

> install.packages("RCurl")
Installing package(s) into ‘/home/username/R/x86_64-redhat-linux-gnu-library/2.13’
(as ‘lib’ is unspecified)
trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/RCurl_1.95-3.tar.gz'
Content type 'application/x-gzip' length 868491 bytes (848 Kb)
opened URL
==================================================
downloaded 848 Kb

* installing *source* package ‘RCurl’ ...
checking for curl-config... no
Cannot find curl-config
ERROR: configuration failed for package ‘RCurl’
* removing ‘/home/username/R/x86_64-redhat-linux-gnu-library/2.13/RCurl’
Warning in install.packages :
  installation of package 'RCurl' had non-zero exit status

The downloaded packages are in
    ‘/tmp/RtmpKyAgF8/downloaded_packages’

と:

> install.packages("XML")
Installing package(s) into ‘/home/username/R/x86_64-redhat-linux-gnu-library/2.13’
(as ‘lib’ is unspecified)
trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/XML_3.95-0.1.tar.gz'
Content type 'application/x-gzip' length 1724282 bytes (1.6 Mb)
opened URL
==================================================
downloaded 1.6 Mb

* installing *source* package ‘XML’ ...
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
No ability to remove finalizers on externalptr objects in this verison of R
checking for sed... /bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking for xml2-config... no
Cannot find xml2-config
ERROR: configuration failed for package ‘XML’
* removing ‘/home/username/R/x86_64-redhat-linux-gnu-library/2.13/XML’
Warning in install.packages :
  installation of package 'XML' had non-zero exit status

The downloaded packages are in
    ‘/tmp/RtmpKyAgF8/downloaded_packages’
4

4 に答える 4

3

CentOS 6.4 で実行すると、次の手順にうまく従うことができました。

  1. Linux コマンド ラインで curl-devel と libxml をインストールします。
$ sudo yum install curl curl-devel
$ sudo yum -y install libxml2 libxml2-devel
  1. R コンソールで R セッションを再起動し、RCurl および XML パッケージをインストールします。
>> install.packages("RCurl")
>> install.packages("XML")
  1. ライブラリをロードします。
>> library(RCurl)
>> library(XML)

これで 1 日節約できることを願っています。

于 2015-02-03T19:00:33.370 に答える
2

RCurl と XML のバージョンを、使用している R のバージョンと一致させる必要があります。R のバージョンは現在のバージョンよりもメジャー バージョンが 1 つ遅れているため、XML と Rcurl の現在のバージョンが一致すると考える理由はありません。それらのアーカイブ バージョンからインストールを試すことができます。約1年半前のものを選ぶか、Rのインストールを更新するだけです。

@TylerRinker からのそのリンクには、間違った OS の間違ったバージョンのものであるにもかかわらず、有用な情報のカーネルがあるかもしれません。URL を切り取り、代わりにhttp://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.13/を参照すると、ソース パッケージのどのバージョンを使用するかを判断できます。 Redhat の古いバージョンの R に使用します。

于 2012-12-12T19:53:37.810 に答える
0

RCurl のインストール時に同様の問題が発生しました。私が必要としていたパッケージは、Amazon Linux では libcurl-devel と呼ばれ、私の質問に答えたこの投稿によると、CentOS もそうでした。コマンドでインストールできますsudo yum install libcurl-devel。Debian ベースのディストリビューションを使用している場合、パッケージの名前が異なる場合があり、apt を使用してインストールされます。

XML ライブラリの問題には、おそらく同様の解決策があります。

于 2015-01-06T01:54:48.450 に答える