在R 3.3.3中无法安装'tm'包:Rpoppler依赖报错求助
Hey there, let's work through this Rpoppler installation issue that's blocking your tm package setup on RHEL 6 with R 3.3.3. Older R and OS combinations often need specific system dependencies and package versions, so here's a step-by-step fix:
Step 1: Install System-Level Poppler Dependencies
Rpoppler relies on your system's Poppler libraries and development files. First, install these via yum:
sudo yum install poppler-devel poppler-glib-devel
If you get a "package not found" error, you'll need to enable the EPEL repository first (it's a go-to source for extra packages on RHEL 6). Install the EPEL release package with:
sudo rpm -Uvh epel-release-latest-6.noarch.rpm sudo yum update
If the rpm command fails, you can look up the official EPEL rpm path for RHEL 6 to complete this step. Then re-run the poppler-devel installation command.
Step 2: Set Up a Working R Compilation Environment
Compiling R source packages requires basic build tools. Make sure these are installed:
sudo yum install gcc gcc-c++ make
Step 3: Install a Compatible Rpoppler Version
R 3.3.3 is an older release, and the latest Rpoppler versions won't play nice with it. You'll need an archived, compatible version (0.23.11 works perfectly for R 3.3.x):
- Download the compatible source package (version 0.23.11) from CRAN's archive section for Rpoppler. You can use
wgetwith the direct path to the tar.gz file, or download it manually via your browser. - Open R and install the local source package:
install.packages("Rpoppler_0.23.11.tar.gz", repos = NULL, type = "source")
Once this installs without errors, you've fixed the Rpoppler dependency block.
Step 4: Install the tm Package
Now that Rpoppler is set up, install tm again:
install.packages("tm", dependencies = TRUE, repos = "http://cran.us.r-project.org/")
That should do it! If you run into any other issues during the process, feel free to share more details about the errors you see.
内容的提问来源于stack exchange,提问作者Rajesh Reddy B

