VOOZH about

URL: https://qiita.com/Wisteria30/items/60b1660fc373100a0d6f

⇱ OSXでRのパッケージtidyverseのインストールに詰まった #Mac - Qiita


👁 Image
4

Go to list of users who liked

5

Share on X(Twitter)

Share on Facebook

Add to Hatena Bookmark

More than 5 years have passed since last update.

@Wisteria30

OSXでRのパッケージtidyverseのインストールに詰まった

4
Last updated at Posted at 2018-08-24

AdventCalendar 13日目!
人手足りないけどだんないよ精神でいくよ!!!

概要

MacでR言語に入門する際に便利パッケージであるtidyverseのインストールに詰まったので対処法

環境

OS

ProductName:	Mac OS X
ProductVersion:	10.13.6

XCode

Xcode 9.3
Build version 9E145

R

Rversion3.5.1(2018-07-02)--"Feather Spray"Copyright(C)2018TheRFoundationforStatisticalComputingPlatform:x86_64-apple-darwin17.6.0(64-bit)

エラーコード

肝心のエラーコード

>install.packages("tidyverse")Installingpackageinto/usr/local/lib/R/3.5/site-library(aslibisunspecified)alsoinstallingthedependenciesrvest,xml2URL'https://cran.rstudio.com/src/contrib/rvest_0.3.2.tar.gz'を試していますContenttype'application/x-gzip'length1597137bytes(1.5MB)==================================================downloaded1.5MBURL'https://cran.rstudio.com/src/contrib/xml2_1.2.0.tar.gz'を試していますContenttype'application/x-gzip'length251614bytes(245KB)==================================================downloaded245KBURL'https://cran.rstudio.com/src/contrib/tidyverse_1.2.1.tar.gz'を試していますContenttype'application/x-gzip'length61647bytes(60KB)==================================================downloaded60KB*installing*source*packagexml2...**パッケージxml2の解凍およびMD5サムの検証に成功しましたFoundpkg-configcflagsandlibs!UsingPKG_CFLAGS=-I/usr/include/libxml2UsingPKG_LIBS=-L/usr/lib-lxml2-lz-lpthread-licucore-lm-------------------------ANTICONFERROR---------------------------Configurationfailedbecauselibxml-2.0wasnotfound.Tryinstalling:*deb:libxml2-dev(Debian,Ubuntu,etc)*rpm:libxml2-devel(Fedora,CentOS,RHEL)*csw:libxml2_dev(Solaris)Iflibxml-2.0isalreadyinstalled,checkthat'pkg-config'isinyourPATHandPKG_CONFIG_PATHcontainsalibxml-2.0.pcfile.Ifpkg-configisunavailableyoucansetINCLUDE_DIRandLIB_DIRmanuallyvia:RCMDINSTALL--configure-vars='INCLUDE_DIR=... LIB_DIR=...'--------------------------------------------------------------------ERROR:configurationfailedforpackagexml2*removing/usr/local/lib/R/3.5/site-library/xml2Warningininstall.packages:installationofpackagexml2hadnon-zeroexitstatusERROR:dependencyxml2isnotavailableforpackagervest*removing/usr/local/lib/R/3.5/site-library/rvestWarningininstall.packages:installationofpackagervesthadnon-zeroexitstatusERROR:dependenciesrvest,xml2arenotavailableforpackagetidyverse*removing/usr/local/lib/R/3.5/site-library/tidyverseWarningininstall.packages:installationofpackagetidyversehadnon-zeroexitstatusThedownloadedsourcepackagesarein/private/var/folders/mf/h8zpddh14778rlv254chg2000000gs/T/RtmpO6u1wZ/downloaded_packages

対処1

_ANTICONF ERROR_で「libxml2が入ってないよ」的なエラーが出たのでとりあえずインストール

$ brew install lib2xml

再実行するが、同じエラーが出る
何故???

対処2

調べていると、どうもXCode絡みのよう

$ xcode-select --install

入った!!!

>library(tidyverse)Attachingpackages──────────────tidyverse1.2.1ggplot23.0.0purrr0.2.5tibble1.4.2dplyr0.7.6tidyr0.8.1stringr1.3.1readr1.1.1forcats0.3.0Conflicts────────────────tidyverse_conflicts()dplyr::filter()masksstats::filter()dplyr::lag()masksstats::lag()

下の_Conflicts_に関してはデフォルトっぽいのでそのままでOK

まとめ

そもそもXCodeのコマンドラインツールが入ってなかった
学習始めの環境構築で詰まるとモチベーションをグッと持っていかれる、、、

4

Go to list of users who liked

5
0

Go to list of comments

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4

Go to list of users who liked

5