安装Tabulizer时出错 [英] Error in installing Tabulizer

查看:82
本文介绍了安装Tabulizer时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 github 中所述的说明,并使用Chocolatey相应地安装Java-加上安装 rJava 并使用 Sys.setenv(JAVA_HOME ="C:/Program Files/Java/jdk1.8.0_131")在R中设置路径-我已经完成了以下操作在R中:

Using the instructions described in github and installing Java accordingly with Chocolatey -- plus installing rJava and setting the path in R with Sys.setenv(JAVA_HOME = "C:/Program Files/Java/jdk1.8.0_131")-- I've done the following in R:

library(ghit)
library(git2r)
ghit::install_github(c("leeper/tabulizerjars", "leeper/tabulizer"), INSTALL_opts = "--no-multiarch", dependencies = c("Depends", "Imports"))

answer 中提供的解决方案.我收到以下错误:

Which is the solution provided in this answer. I get the following error:

Error in git2r::init(d) : 
  Error in 'git2r_repository_init': Unable to init repository

install_github 中设置选项 VERBOSE = TRUE 我得到以下附加输出:

Setting the option VERBOSE = TRUE in install_github I get the following additional output:

Parsing reponame for 'leeper/tabulizerjars'...
Creating local git repository for tabulizerjars in C:\Users\JOOCAR~1\AppData\Local\Temp\RtmpgnitDP\tabulizerjars1643e0126f5...
Error in git2r::init(d) : 
  Error in 'git2r_repository_init': Unable to init repository

我阅读了 answer ,这似乎与我的用户名有关,间隔并带有重音.但是我该如何配置呢?

I read this answer and it seems that it has to do with my username, which is spaced and has accents. But how do I configure this?

6/4/2017 1:57上午

edit: 6/4/2017 1:57 am

在用户@jaySf回答之后,我运行他的回答的部分代码(因为我已经安装了 rJava devtools ):

Following user @jaySf answer, I run part of the code of his answer (since I've already installed rJava and devtools):

library(rJava) # load and attach 'rJava' now
devtools::install_github("ropensci/tabulizer", args="--no-multiarch")

并出现以下错误:

> library(rJava) # load and attach 'rJava' now
> devtools::install_github("ropensci/tabulizer", args="--no-multiarch")
Downloading GitHub repo ropensci/tabulizer@master
from URL https://api.github.com/repos/ropensci/tabulizer/zipball/master
Installing tabulizer
Downloading GitHub repo ropensci/tabulizerjars@master
from URL https://api.github.com/repos/ropensci/tabulizerjars/zipball/master
Installing tabulizerjars
"C:/R-34~1.0/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL "C:/Users/Joo  \
  Caos/AppData/Local/Temp/Rtmpgh9eJi/devtoolsb3c50925145/ropensci-tabulizerjars-c6cc40e" --library="C:/R-3.4.0/library" --install-tests 

* installing *source* package 'tabulizerjars' ...
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
Error: package or namespace load failed for 'tabulizerjars':
 .onLoad failed in loadNamespace() for 'rJava', details:
  call: inDL(x, as.logical(local), as.logical(now), ...)
  error: unable to load shared object 'C:/R-3.4.0/library/rJava/libs/i386/rJava.dll':
  LoadLibrary failure:  %1 is not a valid Win32 application.

Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
* removing 'C:/R-3.4.0/library/tabulizerjars'
Installation failed: Command failed (1)
"C:/R-34~1.0/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL "C:/Users/Joo  \
  Caos/AppData/Local/Temp/Rtmpgh9eJi/devtoolsb3c4a2835ec/ropensci-tabulizer-a38d957" --library="C:/R-3.4.0/library" --install-tests --no-multiarch 

ERROR: dependency 'tabulizerjars' is not available for package 'tabulizer'
* removing 'C:/R-3.4.0/library/tabulizer'
Installation failed: Command failed (1)

我相信文件目录路径中的用户名可能有问题,但是我不确定.我尝试将 install_github ggplot2 一起使用-`install_github("wch/ggplot2")-效果很好.如果我的猜测是正确的,我该如何编辑文件路径?

I believe that I might have a problem with my username in the file directory path, but I'm not sure. I tried using install_github with ggplot2 --`install_github("wch/ggplot2") -- and it worked fine. If my guess is correct, how can I edit the file path?

问题已解决

我正在同时安装32位和64位文件的情况下运行R.我无法明确说明这样做的问题是什么,因为当我运行 Sys.getenv("R_ARCH")时,它先前返回了 x64 ,但是当我卸载32位时文件,它与@jaySf代码完美运行.

I was running R with both 32 bit and 64 bit files installed. I cannot clearly state what were the problems in doing this, since as I ran Sys.getenv("R_ARCH") it returned x64 previously, but when I uninstalled the 32 bit files, it ran perfectly well with @jaySf code.

推荐答案

按照给定顺序执行以下步骤应该可以:

Follow these steps in given order should work:

install.packages("rJava")
library(rJava) # load and attach 'rJava' now
install.packages("devtools")
devtools::install_github("ropensci/tabulizer", args="--no-multiarch")

我在win64上使用R 3.4.0,并在

I'm using R 3.4.0 on win64, and described the procedure in a former answer.

这篇关于安装Tabulizer时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆