【问题标题】:Error message at installation of Rttf2pt1 version 1.3.8 in R在 R 中安装 Rttf2pt1 版本 1.3.8 时出现错误消息
【发布时间】:2021-11-06 18:24:33
【问题描述】:

我正在尝试将 Windows 字体导入 R/R.Stuido(与 Windows 10 一起使用的两个最新版本)。前段时间,我在另一台 Windows 10 设备上使用此代码成功:

install.packages("pkgbuild")
library(extrafont)
library(remotes)
remotes::install_version("Rttf2pt1", version = "1.3.8")
extrafont::font_import()

当我尝试在实际设备上重新运行该设备时,我在安装相应的 Rttf2pt1 版本时遇到了麻烦。似乎遇到了安装问题,错误信息如下:

Downloading package from url: https://cran.rstudio.com//src/contrib/Archive/Rttf2pt1/Rttf2pt1_1.3.8.tar.gz
Installing package into ‘C:/Users/.../R/win-library/4.1’
(as ‘lib’ is unspecified)
* installing *source* package 'Rttf2pt1' ...
** package 'Rttf2pt1' successfully unpacked and MD5 sums checked
** using staged installation
** libs
  running 'src/Makefile.win' ...
echo "make ttf2pt1 in ttf2pt1/ ..."
make ttf2pt1 in ttf2pt1/ ...
(cd ttf2pt1; /c/PROGRA~1/rtools40/usr/bin/make -f "C:/PROGRA~1/R/R-41~1.1/etc/x64/Makeconf" -f Makefile CC="`"C:/PROGRA~1/R/R-41~1.1/bin/R" CMD config CC`" CFLAGS="`"C:/PROGRA~1/R/R-41~1.1/bin/R" CMD config CFLAGS`  -DWINDOWS -Wno-comment -Wno-format -Wno-logical-op-parentheses -Wno-pointer-sign -Wno-unused-function -Wno-unused-variable -Wno-parentheses -Wno-unused-label -Wno-maybe-uninitialized -Wno-unused-but-set-variable -Wno-unused-value" ttf2pt1)
C:/Program Files/rtools40/mingw64/bin/gcc -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -DWINDOWS -Wno-comment -Wno-format -Wno-logical-op-parentheses -Wno-pointer-sign -Wno-unused-function -Wno-unused-variable -Wno-parentheses -Wno-unused-label -Wno-maybe-uninitialized -Wno-unused-but-set-variable -Wno-unused-value -c ttf2pt1.c
make[1]: C:/Program: Command not found
make[1]: *** [Makefile:185: ttf2pt1.o] Error 127
make: *** [Makefile.win:16: all] Error 2
ERROR: compilation failed for package 'Rttf2pt1'
* removing 'C:/Users/.../R/win-library/4.1/Rttf2pt1'
* restoring previous 'C:/Users/.../R/win-library/4.1/Rttf2pt1'
Warning message:
In i.p(...) :
  installation of package ‘C:/Users/.../Rttf2pt1’ had non-zero exit status

任何想法如何解决这个问题?谢谢你的帮助

【问题讨论】:

    标签: r windows installation import fonts


    【解决方案1】:

    如果您的 PC 上当前安装了较新版本的 Rttf2pt1 软件包,请将其删除。然后按照link 中提供的解决方案从 CRAN 存储库安装旧版本 (1.3.8)。在您的情况下,此代码将解决它:

    url <- "https://cran.r-project.org/src/contrib/Archive/Rttf2pt1/Rttf2pt1_1.3.8.tar.gz"
    
    install.packages(url, repos=NULL, type="source")
    

    【讨论】:

      【解决方案2】:

      我看到你在C:/Program Files/ 上安装了 Rtools。

      尝试卸载 Rtools,然后将其重新安装到默认安装路径 C:/rtools40

      希望它能解决您的问题。它修复了我的。

      【讨论】:

        【解决方案3】:

        我可以通过从我的旧电脑复制粘贴包来解决它。

        【讨论】:

        • 您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center
        猜你喜欢
        • 2020-08-16
        • 1970-01-01
        • 2021-07-31
        • 2013-01-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-02-11
        相关资源
        最近更新 更多