首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Rstudio中运行whitebox ("~/whitebox_tools.exe“未找到)

在Rstudio中运行whitebox ("~/whitebox_tools.exe“未找到)
EN

Stack Overflow用户
提问于 2022-03-09 15:22:38
回答 1查看 288关注 0票数 0

我试图在R中运行“白盒”包。

要开始,我遵循链接中的步骤:https://github.com/giswqs/whiteboxR

代码语言:javascript
复制
install.packages("whitebox")
whitebox::install_whitebox()

控制台:

代码语言:javascript
复制
------------------------------------------------------------------------
Could not find WhiteboxTools!
------------------------------------------------------------------------

Your next step is to download and install the WhiteboxTools binary:
    > whitebox::install_whitebox()

If you have WhiteboxTools installed already run `wbt_init(exe_path=...)`': 
    > wbt_init(exe_path='/home/user/path/to/whitebox_tools')

For whitebox package documentation, ask for help:
    > ??whitebox

For more information visit https://giswqs.github.io/whiteboxR/

------------------------------------------------------------------------

Performing one-time download of WhiteboxTools binary from
     https://www.whiteboxgeo.com/WBT_Windows/WhiteboxTools_win_amd64.zip 
(This could take a few minutes, please be patient...)
trying URL 'https://www.whiteboxgeo.com/WBT_Windows/WhiteboxTools_win_amd64.zip'
Content type 'application/zip' length 15383844 bytes (14.7 MB)
downloaded 14.7 MB

WhiteboxTools binary is located here:  C:/Users/frsu0056/OneDrive - Umeå universitet/Documents/R/win-library/4.1/whitebox/WBT/whitebox_tools.exe 
You can now start using whitebox
    library(whitebox)
    wbt_version()

下载后,我运行:

代码语言:javascript
复制
library(whitebox)
if(wbt_init()==TRUE){print("all good")}#confirms if the whitebox_tools.exe exists in,'C:/Users/frsu0056/OneDrive - Umeå universitet/Documents/R/win-library/4.1/whitebox/WBT/whitebox_tools.exe'.

控制台:

代码语言:javascript
复制
[1] "all good"

现在,如果我试图运行白盒包中的任何函数,它将返回一条奇怪的错误消息。

例如

代码语言:javascript
复制
wbt_version()

返回:

代码语言:javascript
复制
Error : 
Error running WhiteboxTools
  whitebox.exe_path: "C:/Users/frsu0056/OneDrive - Umeå universitet/Documents/R/win-library/4.1/whitebox/WBT/whitebox_tools.exe"; File exists? TRUE
  Arguments: --version

Error in system(exeargs, intern = TRUE, ignore.stderr = ignore.stderr, : '"C:/Users/frsu0056/OneDrive - Umeå universitet/Documents/R/win-library/4.1/whitebox/WBT/whitebox_tools.exe"' not found

然而,wbt_init()返回TRUE,因此该文件存在于给定的目录中。但是,wbt_version()函数找不到它。

因此,这个故事适用于白盒包中的任何功能。它只是找不到.exe文件,但是文件存在于它应该在的文件夹中。

其他人也会遇到同样的问题吗?这里有什么问题吗?

下面是位于目录中的.exe文件。

EN

回答 1

Stack Overflow用户

发布于 2022-11-10 21:44:58

在我的经验中,白盒的问题是它不能解码空间。我不认为问题在于单驱动器文件夹本身,只是文件路径中有空格。我建议不要将软件包安装在一个驱动器文件夹或路径有空格的任何其他文件夹中。若要更改安装库的文件夹,请参阅解决方案:Change R default library path using .libPaths in Rprofile.site fails to work

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71411760

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档