首页 > 解决方案 > 安装 sdsMirco 时出错:在 pkg-config 搜索路径中找不到软件包 libcurl

问题描述

我需要使用sdcMicro包。

我首先尝试简单地包含它:

> library(sdcMicro)

这给了我`

没有名为“sdcMicro”的包

我尝试安装它:

> install.packages("sdcMicro")

它运行了很长时间,并为我提供了一个我无法真正破译其含义的输出:

ERROR: configuration failed for package ‘curl’
* removing ‘/home/ask/R/x86_64-pc-linux-gnu-library/3.6/curl’
Warning in install.packages :
  installation of package ‘curl’ had non-zero exit status
ERROR: dependency ‘curl’ is not available for package ‘rio’
* removing ‘/home/ask/R/x86_64-pc-linux-gnu-library/3.6/rio’
Warning in install.packages :
  installation of package ‘rio’ had non-zero exit status
ERROR: dependency ‘rio’ is not available for package ‘car’
* removing ‘/home/ask/R/x86_64-pc-linux-gnu-library/3.6/car’
Warning in install.packages :
  installation of package ‘car’ had non-zero exit status
ERROR: dependency ‘car’ is not available for package ‘VIM’
* removing ‘/home/ask/R/x86_64-pc-linux-gnu-library/3.6/VIM’
Warning in install.packages :
  installation of package ‘VIM’ had non-zero exit status
ERROR: dependencies ‘car’, ‘VIM’ are not available for package ‘sdcMicro’
* removing ‘/home/ask/R/x86_64-pc-linux-gnu-library/3.6/sdcMicro’
Warning in install.packages :
  installation of package ‘sdcMicro’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpBP1CoD/downloaded_packages’

好像有点模棱两可,一堆依赖失败了,但是包安装了。

让我们检查一下,我运行library(sdcMicro)并且require(sdcMicro). 以与以前相同的方式失败。

我现在浏览了一下文档。在这里它说我应该尝试运行update.packages()并再试一次。我这样做了,然后再试一次,没有效果。

在文档中,它还说依赖项将自动与包一起安装,所以也许这不是我的问题?

我怎样才能得到这个包裹?

编辑

我现在尝试一一安装失败的依赖项(“car”、“rio”、“curl”)。完全相同的事情仍在发生

编辑 2

根据要求,这是依赖项的安装:

第一次卷曲:

> install.packages("curl")
Installing package into ‘/home/ask/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/curl_4.3.2.tar.gz'
Content type 'application/x-gzip' length 793345 bytes (774 KB)
==================================================
downloaded 774 KB

* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
** using staged installation
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lcurl
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libcurl was not found. Try installing:
 * deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
 * rpm: libcurl-devel (Fedora, CentOS, RHEL)
 * csw: libcurl_dev (Solaris)
If libcurl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘curl’
* removing ‘/home/ask/R/x86_64-pc-linux-gnu-library/3.6/curl’
Warning in install.packages :
  installation of package ‘curl’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpUpG4q8/downloaded_packages’

标签: r

解决方案


推荐阅读