安装 R 包时 R 无法识别已安装的库

安装 R 包时 R 无法识别已安装的库

我正在 R 中安装openssl、、和包haven。它们需要库,但是库已经安装好了。curlsystemfonts

详细代码和信息如下。

提前感谢您的任何帮助!:)

openssl

在 R 中:

** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=
--------------------------- [ANTICONF] --------------------------------
Configuration failed because openssl was not found. Try installing:
 * deb: libssl-dev (Debian, Ubuntu, etc)
 * rpm: openssl-devel (Fedora, CentOS, RHEL)
 * csw: libssl_dev (Solaris)
 * brew: [email protected] (Mac OSX)
If openssl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a openssl.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 MESSAGE] ---------------------------
tools/version.c:1:10: fatal error: openssl/opensslv.h: No such file or directory
 #include <openssl/opensslv.h>
          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.

在 bash shell 中:

$ aptitude install libssl-dev
libssl-dev is already installed at the requested version (1.1.1-1ubuntu2.1~18.04.9)
libssl-dev is already installed at the requested version (1.1.1-1ubuntu2.1~18.04.9)
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

haven

在 R 中:

readstat/spss/readstat_sav_write.c:25:10: fatal error: zlib.h: No such file or directory
 #include <zlib.h>
          ^~~~~~~~
compilation terminated.
make: *** [/usr/lib/R/etc/Makeconf:168: readstat/spss/readstat_sav_write.o] Error 1
ERROR: compilation failed for package ‘haven’

在 bash shell 中:

$ aptitude install libz-dev zlib1g-dev
zlib1g-dev is already installed at the requested version (1:1.2.11.dfsg-0ubuntu2)
zlib1g-dev is already installed at the requested version (1:1.2.11.dfsg-0ubuntu2)
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

curl

在 R 中:

** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/include/x86_64-linux-gnu
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’

在 bash shell 中:

$ aptitude install libcurl4-openssl-dev
libcurl4-openssl-dev is already installed at the requested version (7.58.0-2ubuntu3.13)
libcurl4-openssl-dev is already installed at the requested version (7.58.0-2ubuntu3.13)
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

systemfonts

在 R 中:

** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16
Using PKG_LIBS=-lfontconfig -lfreetype
--------------------------- [ANTICONF] --------------------------------
Configuration failed to find the fontconfig freetype2 library. Try installing:
 * deb: libfontconfig1-dev (Debian, Ubuntu, etc)
 * rpm: fontconfig-devel (Fedora, EPEL)
 * csw: fontconfig_dev (Solaris)
 * brew: freetype (OSX)
If fontconfig freetype2 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a fontconfig freetype2.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 MESSAGE] ---------------------------
<stdin>:1:10: fatal error: fontconfig/fontconfig.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘systemfonts’

在 bash shell 中:

$ aptitude install libfontconfig1-dev
libfontconfig1-dev is already installed at the requested version (2.12.6-0ubuntu2)
libfontconfig1-dev is already installed at the requested version (2.12.6-0ubuntu2)
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

系统

我使用Ubuntu 18.04系统,R版本4.1.0(2021-05-18)。

平台:x86_64-pc-linux-gnu(64位)

相关内容