簡體   English   中英

Brew安裝后無法將軟件包安裝到R

[英]Cannot install packages to R after brew install

我花了大約一個小時的時間來調試它,但是我認為最好假設除了install.packages("tidycensus") brew install rinstall.packages("tidycensus")以及其他一些軟件包以外,我沒有嘗試任何其他方法來檢查是否是tidycensus

讓我知道我是否可以提供任何信息。 我最近擦除了相當新的Mac的硬盤,然后重新開始。

install.packages("tidycensus")的輸出:

> install.packages("tidycensus")
Installing package into ‘/usr/local/lib/R/3.5/site-library’
(as ‘lib’ is unspecified)
also installing the dependencies ‘rgdal’, ‘sf’, ‘tigris’, ‘units’

trying URL 'https://cloud.r-project.org/src/contrib/rgdal_1.3-4.tar.gz'
Content type 'application/x-gzip' length 1664774 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

trying URL 'https://cloud.r-project.org/src/contrib/sf_0.6-3.tar.gz'
Content type 'application/x-gzip' length 7973054 bytes (7.6 MB)
==================================================
downloaded 7.6 MB

trying URL 'https://cloud.r-project.org/src/contrib/tigris_0.7.tar.gz'
Content type 'application/x-gzip' length 72980 bytes (71 KB)
==================================================
downloaded 71 KB

trying URL 'https://cloud.r-project.org/src/contrib/units_0.6-0.tar.gz'
Content type 'application/x-gzip' length 912393 bytes (891 KB)
==================================================
downloaded 891 KB

trying URL 'https://cloud.r-project.org/src/contrib/tidycensus_0.4.6.tar.gz'
Content type 'application/x-gzip' length 1615516 bytes (1.5 MB)
==================================================
downloaded 1.5 MB

* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: R_HOME: /usr/local/Cellar/r/3.5.1/lib/R
configure: CC: clang
configure: CXX: clang++
configure: C++11 support available
configure: rgdal: 1.3-4
checking for /usr/bin/svnversion... yes
configure: svn revision: 766
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/usr/local/lib/R/3.5/site-library/rgdal’
* installing *source* package ‘units’ ...
** package ‘units’ successfully unpacked and MD5 sums checked
configure: units: 0.6-0
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking how to run the C++ preprocessor... clang++ -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdbool.h that conforms to C99... no
checking for _Bool... no
checking for error_at_line... no
checking for gcc... clang
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking for XML_ParserCreate in -lexpat... yes
checking udunits2.h usability... no
checking udunits2.h presence... no
checking for udunits2.h... no
checking udunits2/udunits2.h usability... no
checking udunits2/udunits2.h presence... no
checking for udunits2/udunits2.h... no
checking for ut_read_xml in -ludunits2... no
configure: error: in `/private/var/folders/69/wy4n7cc10n5fg5_bc8glmms80000gn/T/RtmpPtsVPP/R.INSTALLf8694f0bf387/units':
configure: error: 
--------------------------------------------------------------------------------
  libudunits2.so not found!

  If the udunits2 library is installed in a non-standard location, use:

    --configure-args='--with-udunits2-lib=/usr/local/lib'

  for example, if the library was not found, and/or

    --configure-args='--with-udunits2-include=/usr/include/udunits2'

  if the header was not found, replacing paths with appropriate values for your
  installation. You can alternatively use the UDUNITS2_INCLUDE and UDUNITS2_LIBS
  environment variables.

  If udunits2 is not installed, please install it.
  It is required for this package.
--------------------------------------------------------------------------------

See `config.log' for more details
ERROR: configuration failed for package ‘units’
* removing ‘/usr/local/lib/R/3.5/site-library/units’
ERROR: dependency ‘units’ is not available for package ‘sf’
* removing ‘/usr/local/lib/R/3.5/site-library/sf’
ERROR: dependencies ‘rgdal’, ‘sf’ are not available for package ‘tigris’
* removing ‘/usr/local/lib/R/3.5/site-library/tigris’
ERROR: dependencies ‘sf’, ‘tigris’, ‘units’ are not available for package ‘tidycensus’
* removing ‘/usr/local/lib/R/3.5/site-library/tidycensus’

The downloaded source packages are in
    ‘/private/var/folders/69/wy4n7cc10n5fg5_bc8glmms80000gn/T/Rtmp8iit6a/downloaded_packages’
Warning messages:
1: In install.packages("tidycensus") :
  installation of package ‘rgdal’ had non-zero exit status
2: In install.packages("tidycensus") :
  installation of package ‘units’ had non-zero exit status
3: In install.packages("tidycensus") :
  installation of package ‘sf’ had non-zero exit status
4: In install.packages("tidycensus") :
  installation of package ‘tigris’ had non-zero exit status
5: In install.packages("tidycensus") :
  installation of package ‘tidycensus’ had non-zero exit status
> install.packages('tidycensus')
Installing package into ‘/usr/local/lib/R/3.5/site-library’
(as ‘lib’ is unspecified)
also installing the dependencies ‘rgdal’, ‘sf’, ‘tigris’, ‘units’

trying URL 'https://cloud.r-project.org/src/contrib/rgdal_1.3-4.tar.gz'
Content type 'application/x-gzip' length 1664774 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

trying URL 'https://cloud.r-project.org/src/contrib/sf_0.6-3.tar.gz'
Content type 'application/x-gzip' length 7973054 bytes (7.6 MB)
==================================================
downloaded 7.6 MB

trying URL 'https://cloud.r-project.org/src/contrib/tigris_0.7.tar.gz'
Content type 'application/x-gzip' length 72980 bytes (71 KB)
==================================================
downloaded 71 KB

trying URL 'https://cloud.r-project.org/src/contrib/units_0.6-0.tar.gz'
Content type 'application/x-gzip' length 912393 bytes (891 KB)
==================================================
downloaded 891 KB

trying URL 'https://cloud.r-project.org/src/contrib/tidycensus_0.4.6.tar.gz'
Content type 'application/x-gzip' length 1615516 bytes (1.5 MB)
==================================================
downloaded 1.5 MB

* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: R_HOME: /usr/local/Cellar/r/3.5.1/lib/R
configure: CC: clang
configure: CXX: clang++
configure: C++11 support available
configure: rgdal: 1.3-4
checking for /usr/bin/svnversion... yes
configure: svn revision: 766
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/usr/local/lib/R/3.5/site-library/rgdal’
* installing *source* package ‘units’ ...
** package ‘units’ successfully unpacked and MD5 sums checked
configure: units: 0.6-0
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking how to run the C++ preprocessor... clang++ -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdbool.h that conforms to C99... no
checking for _Bool... no
checking for error_at_line... no
checking for gcc... clang
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking for XML_ParserCreate in -lexpat... yes
checking udunits2.h usability... no
checking udunits2.h presence... no
checking for udunits2.h... no
checking udunits2/udunits2.h usability... no
checking udunits2/udunits2.h presence... no
checking for udunits2/udunits2.h... no
checking for ut_read_xml in -ludunits2... no
configure: error: in `/private/var/folders/69/wy4n7cc10n5fg5_bc8glmms80000gn/T/RtmpuOGf6j/R.INSTALLfdd5361d965a/units':
configure: error: 
--------------------------------------------------------------------------------
  libudunits2.so not found!

  If the udunits2 library is installed in a non-standard location, use:

    --configure-args='--with-udunits2-lib=/usr/local/lib'

  for example, if the library was not found, and/or

    --configure-args='--with-udunits2-include=/usr/include/udunits2'

  if the header was not found, replacing paths with appropriate values for your
  installation. You can alternatively use the UDUNITS2_INCLUDE and UDUNITS2_LIBS
  environment variables.

  If udunits2 is not installed, please install it.
  It is required for this package.
--------------------------------------------------------------------------------

See `config.log' for more details
ERROR: configuration failed for package ‘units’
* removing ‘/usr/local/lib/R/3.5/site-library/units’
ERROR: dependency ‘units’ is not available for package ‘sf’
* removing ‘/usr/local/lib/R/3.5/site-library/sf’
ERROR: dependencies ‘rgdal’, ‘sf’ are not available for package ‘tigris’
* removing ‘/usr/local/lib/R/3.5/site-library/tigris’
ERROR: dependencies ‘sf’, ‘tigris’, ‘units’ are not available for package ‘tidycensus’
* removing ‘/usr/local/lib/R/3.5/site-library/tidycensus’

The downloaded source packages are in
    ‘/private/var/folders/69/wy4n7cc10n5fg5_bc8glmms80000gn/T/Rtmp8iit6a/downloaded_packages’
Warning messages:
1: In install.packages("tidycensus") :
  installation of package ‘rgdal’ had non-zero exit status
2: In install.packages("tidycensus") :
  installation of package ‘units’ had non-zero exit status
3: In install.packages("tidycensus") :
  installation of package ‘sf’ had non-zero exit status
4: In install.packages("tidycensus") :
  installation of package ‘tigris’ had non-zero exit status
5: In install.packages("tidycensus") :
  installation of package ‘tidycensus’ had non-zero exit status

對我來說很好。 可能的解決方案:

  1. 檢查是否通過github install_github("tidyverse/ggplot2")安裝了install_github("tidyverse/ggplot2")
  2. 確認您的R版本≥3.3.0
  3. 通過github install_github("walkerke/tidycensus")安裝軟件包
  4. 檢查其他依賴

我的問題是,在未經過簡裝的python3安裝后,我有一些雜散的python3配置文件在浮動。 我刪除了python3並重新安裝了brew。

我對有相同問題的用戶的建議是運行brew doctor 如果您遇到的問題與我相同,則您的python3配置文件將顯示為問題,您可以卸載python3並使用brew install python3重新安裝它。

然后,我需要處理一些依賴關系,一些依賴關系在R中,有些則在brew中。

@comfort eagle在安裝和導入devtools之后使用install_github()的建議也很有幫助。

暫無
暫無

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

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