RolyPolyCoily / NGSv2

NGS教本v2
7 stars 6 forks source link

p103:rhdf5がインストールできない? #8

Open Ayum-dev opened 2 years ago

Ayum-dev commented 2 years ago

こんにちは。 お世話になっております。 初心者です。

p103のところで library("sleuth")と入力すると

 library("sleuth") でエラー: 
   ‘sleuth’ という名前のパッケージはありません 

となってしまい、その先に進めていない状況です。

R3.5以上のR4.1.2なので、

if (!requireNamespace("BiocManager", quietly = TRUE))install.packages("BiocManager") BiocManager::install("rhdf5")

としましたが

'getOption("repos")' replaces Bioconductor standard repositories, see
'?repositories' for details

replacement repositories:
    CRAN: https://cran.ism.ac.jp

Bioconductor version 3.14 (BiocManager 1.30.16), R 4.1.2 (2021-11-01)
 警告メッセージ: 
package(s) not installed when version(s) same as current; use `force = TRUE` to
  re-install: 'rhdf5' 

のような警告メッセージがでます。

install.packages("devtools")を入力すると、

 URL 'https://cran.ism.ac.jp/bin/macosx/contrib/4.1/devtools_2.4.2.tgz' を試しています 
 Content type 'application/x-gzip' length 393913 bytes (384 KB)
 ==================================================
 downloaded 384 KB

 The downloaded binary packages are in
    /var/folders/7y/x7jc917574scnwm18810shdr0000gn/T//RtmpL6valw/downloaded_packages

上のようなメッセージがでて、 その後 devtools::install_github("pachterlab/sleuth")を入力すると下のようなメッセージがでます。

 Downloading GitHub repo pachterlab/sleuth@HEAD
 Skipping 1 packages not available: rhdf5
 ✔  checking for file ‘/private/var/folders/7y/x7jc917574scnwm18810shdr0000gn/T/RtmpL6valw/remotes1367366f8e3eb/pachterlab-sleuth-e5ac761/DESCRIPTION’ ...
> ─  preparing ‘sleuth’:
> ✔  checking DESCRIPTION meta-information ...
> ─  checking for LF line-endings in source and make files and shell scripts
> ─  checking for empty or unneeded directories
>    Omitted ‘LazyData’ from DESCRIPTION
> ─  building ‘sleuth_0.30.0.tar.gz’
>    
> * installing *source* package ‘sleuth’ ...
> ** using staged installation
> ** R
> ** inst
> ** byte-compile and prepare package for lazy loading
>  エラー:  オブジェクト ‘h5write.default’ は 'namespace:rhdf5' によってエクスポートされていません 
>  実行が停止されました 
> ERROR: lazy loading failed for package ‘sleuth’
> * removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/sleuth’
>  警告メッセージ: 
>  i.p(...) で: 
>   installation of package ‘/var/folders/7y/x7jc917574scnwm18810shdr0000gn/T//RtmpL6valw/file136735e3b8e1d/sleuth_0.30.0.tar.gz’ had non-zero exit status

どうもrhdf5のインストールがうまくいっていないのだと思いますが、何が悪いのかわかりません。 お知恵をお貸しください。 よろしくお願いいたします。

RolyPolyCoily commented 2 years ago

@Ayum-dev ご連絡ありがとうございます。似たエラーが出ている人がいますが、解決策は現時点では提示されていないようです。 期待はできませんが、公式ページにある、BiocManager::install("pachterlab/sleuth") を実行してみていただけますでしょうか。 解決が難しい場合は、condaの仮想環境を準備して、そこにRやsleuthをインストールするのが手っ取り早いかもしれません。 たとえば:

conda create -n test
conda activate test
conda install --channel bioconda r-sleuth
which R
R
library(sleuth)
...
q()
conda deactivate

のようなコマンドでsleuthを使えるのではないかと思います。