簡體   English   中英

無法使用 jupyter 筆記本安裝任何 R package

[英]Can't install any R package with jupyter notebook

每當我嘗試使用 jupyter 筆記本安裝任何 package 時,我都會收到此錯誤

  There is a binary version available but the source version is later:
     binary source needs_compilation
Rcpp  1.0.6  1.0.8              TRUE

installing the source package 'Rcpp'

Warning message in install.packages("Rcpp"):
"installation of package 'Rcpp' had non-zero exit status"

對於這個特定的 package,我可以使用 conda conda install安裝它,但是像lifecontingencies這樣的一些包不起作用,我通過install.packages('lifecontingencies')收到了這條消息

also installing the dependencies 'Rcpp', 'markovchain'


  There are binary versions available but the source versions are later:
                   binary source needs_compilation
Rcpp                1.0.6  1.0.8              TRUE
markovchain       0.8.5-4  0.8.6              TRUE
lifecontingencies   1.3.7  1.3.8              TRUE

installing the source packages 'Rcpp', 'markovchain', 'lifecontingencies'

Warning message in install.packages("lifecontingencies"):
"installation of package 'Rcpp' had non-zero exit status"Warning message in install.packages("lifecontingencies"):
"installation of package 'markovchain' had non-zero exit status"Warning message in install.packages("lifecontingencies"):
"installation of package 'lifecontingencies' had non-zero exit status"

我用 Conda 得到了這個

在此處輸入圖像描述

有沒有辦法修復 jupyter notebook 中的install.packages命令? 我的R版本是3.6.1 (2019-07-05)

CRAN package lifedependencies現在可以通過 Conda Forge 獲得。 1我一般建議所有 Conda R 環境都應該從 Conda 源包,否則很可能會遇到編譯(實際上是庫鏈接)問題。

conda install -c conda-forge r-lifedependencies

但是請注意,目前僅適用於 R 4.0 和 4.1。 如果確實需要 R 3.6 版本,請通過在 feedstock 上提交 Issue 來請求它。

為了將來參考,在這個答案中有一些關於將 CRAN 包添加到 Conda Forge 的細節。


[1]:請注意,R 包在 Conda 生態系統中通常以r-為前綴。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM