gpt4 book ai didi

r - 在 Ubuntu 系统上的 R 中安装 Sodium 包时出现问题

转载 作者:行者123 更新时间:2023-12-04 18:24:52 27 4
gpt4 key购买 nike

我正在尝试安装一个名为 sodium 的软件包在 Ubuntu 系统上的 R 中,但我收到如下错误消息:

install.packages("sodium", dependencies = T)

...

* installing *source* package ‘sodium’ ...
** package ‘sodium’ successfully unpacked and MD5 sums checked
Package libsodium was not found in the pkg-config search path.
Perhaps you should add the directory containing `libsodium.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libsodium' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lsodium
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libsodium was not found. Try installing:
* deb: libsodium-dev (Debian, Ubuntu, etc)
* rpm: libsodium-devel (Fedora, EPEL)
* csw: libsodium_dev (Solaris)
* brew: libsodium (OSX)
If libsodium is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libsodium.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 ‘sodium’
* removing ‘/R/x86_64-pc-linux-gnu-library/3.4/sodium’
Warning in install.packages :
installation of package ‘sodium’ had non-zero exit status

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

以下代码也没有安装它。
install.packages("libsodium-dev", dependencies = T)

Warning in install.packages :
package ‘libsodium-dev’ is not available (for R version 3.4.4)

我也试过 install_github但仍然出现错误:
devtools::install_github("jedisct1/libsodium")

Error: Failed to install 'unknown package' from GitHub:
Timeout was reached: [api.github.com] Resolving timed out after 10000 milliseconds

关于如何安装这个包的任何想法?

我希望在 Ubuntu R 上安装软件包就像在 Windows R 上一样没有错误。
如果有人能教我如何避免 Ubuntu R 中的软件包安装错误,那就太好了。

最佳答案

您需要安装libsodium-dev ,用于您的计算机的一些软件,不一定是 R 特定的。

您可以通过 linux 中的终端执行此操作。转到您的终端并执行
sudo apt install libsodium-dev
然后回到 R 并使用通常的命令安装包
devtools::install_github("jedisct1/libsodium")

关于r - 在 Ubuntu 系统上的 R 中安装 Sodium 包时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61454457/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com