0

我正在尝试安装 R 包“pdftools”并遇到以下情况:

In file included from libqpdf/Pl_DCT.cc:1:
include/qpdf/Pl_DCT.hh:27:10: fatal error: 'jpeglib.h' file not found
#include <jpeglib.h>
         ^
1 error generated.
make: *** [libqpdf/Pl_DCT.o] Error 1
ERROR: compilation failed for package ‘qpdf’

我在装有 OS X 10.10.5 的 Mac 上使用 R 版本 3.3.3,由于多种原因,目前无法更新我的操作系统。

  1. 我验证下载的源包在:/private/var/folders/t3/_mlp_5z15z9_628n5q00pw_s8d_kfs/T/RtmpnJERsz/downloaded_pa​​ckages

  2. 我看到了以下帖子: 找不到'jpeglib.h'文件

然后跑了

$ find /usr/local -name \*jpeg\* -print -name \*jpg\* -print
/usr/local/Cellar/boost/1.71.0/include/boost/gil/extension/io/jpeg
/usr/local/Cellar/boost/1.71.0/include/boost/gil/extension/io/jpeg.hpp
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Aliases/libjpeg
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Aliases/libjpeg-turbo
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/jpeg-archive.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/jpeg-turbo.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/jpeg.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/jpeginfo.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/jpegoptim.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/jpegrescan.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/mjpegtools.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/mozjpeg.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/openjpeg.rb
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/recoverjpeg.rb
find: /usr/local/jamf: Permission denied

文件“jpeglib.h”似乎没有列出,但我将它定位在:/anaconda3/pkgs/jpeg-9b-he5867d9_2/include/jpeglib.h

  1. 根据其他帖子,我从终端尝试过:
$ brew install boost. (Lot of installing, no errors)
$ brew doctor (Lot of installing, no errors)
$ xcode-select: error: command line tools are already installed, use "Software Update" to install updates
$ brew install cairo gobject-introspection pixman (Lot of installing, no errors)

然后重新启动并尝试再次安装 pdftools,结果相同。

  1. 也看到了这篇文章,但完全超出了我的想象: https ://www.cocoanetics.com/2012/01/helping-xcode-find-library-headers/

任何简单步骤的解决方案都值得赞赏。

4

1 回答 1

0

这是我的会话信息,由于限制,我无法将其包含在评论中。

> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods  
[7] base     

other attached packages:
[1] pdftools_2.2

loaded via a namespace (and not attached):
[1] compiler_3.4.3 tools_3.4.3    pillar_1.2.1   tibble_1.4.2  
[5] Rcpp_1.0.1     qpdf_1.1       rlang_0.3.0.1  askpass_1.1

我刚刚安装了 pdftools 没有任何问题。升级您的 R 版本可能会解决您的问题。

于 2019-10-20T18:04:15.590 回答