【问题标题】:I am trying to install the twitteR package in R but I am unable to do so我正在尝试在 R 中安装 twitteR 包,但我无法这样做
【发布时间】:2019-06-05 16:56:15
【问题描述】:

我正在尝试使用 install.packages("twitteR") 从控制台在 Rstudio 中安装 twitteR 包,但它总是失败。[我使用的操作系统是 ubuntu] 以下是我发出命令后显示的消息:

>install.packages("twitteR")
Installing package into ‘/home/siddhinath/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependencies ‘curl’, ‘httr’

trying URL 'https://cloud.r-project.org/src/contrib/curl_3.3.tar.gz'
Content type 'application/x-gzip' length 371740 bytes (363 KB)
==================================================
downloaded 363 KB

trying URL 'https://cloud.r-project.org/src/contrib/httr_1.4.0.tar.gz'
Content type 'application/x-gzip' length 156356 bytes (152 KB)
==================================================
downloaded 152 KB

trying URL 'https://cloud.r-project.org/src/contrib/twitteR_1.1.9.tar.gz'
Content type 'application/x-gzip' length 215838 bytes (210 KB)
==================================================
downloaded 210 KB

* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
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/siddhinath/R/x86_64-pc-linux-gnu-library/3.4/curl’
Warning in install.packages :
  installation of package ‘curl’ had non-zero exit status
ERROR: dependency ‘curl’ is not available for package ‘httr’
* removing ‘/home/siddhinath/R/x86_64-pc-linux-gnu-library/3.4/httr’
Warning in install.packages :
  installation of package ‘httr’ had non-zero exit status
ERROR: dependency ‘httr’ is not available for package ‘twitteR’
* removing ‘/home/siddhinath/R/x86_64-pc-linux-gnu-library/3.4/twitteR’
Warning in install.packages :
  installation of package ‘twitteR’ had non-zero exit status

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

【问题讨论】:

  • 您看到“ANTICONF ERROR”部分了吗?听起来你没有安装libcurl。如果您是 ubuntu,则应按照错误消息的建议运行 apt-get install libcurl4-openssl-dev`。
  • @MrFlick 感谢它完美运行的建议。

标签: r linux twitter package


【解决方案1】:

运行这个 Linux 命令。

apt-get install libcurl4-openssl-dev

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-24
    • 2021-02-12
    • 2020-10-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多