如何修复“poppler是否已安装且在路径中?”在R

2024-10-02 08:27:58 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用retricate在R中运行一个python脚本。我使用py_discover_config()来查找Python配置。我用的是水蟒。我不太了解环境以及为什么我需要环境。在

我尝试过使用_python()和_condaenv()甚至使用conda_install安装软件包。在

library(tidyverse)
library(jsonlite)
library(reticulate)

py_discover_config()
# Set the path to the Python executable file
source_python("~/projects/stiekemthuis/API.py")

json_list <- api_fun() %>% toJSON()

导入python库没有问题:

^{pr2}$

我在第25行出错:

pages = convert_from_path(files[0], 300)

py_call_impl(可调用,dots$args,dots$关键字)出错: PdfinFoNotInstallerError:无法获取页面计数。poppler安装好了吗?在

我试图将wd()设置为poppler二进制文件的路径。 能做什么?在


Tags: installthepathpy脚本config环境library
1条回答
网友
1楼 · 发布于 2024-10-02 08:27:58

我停止使用这个库(networkite),开始使用system2直接执行python命令,然后是脚本路径:

command = "python"
allArgs = c(path2script)

output = system2(command, args=allArgs, stdout=TRUE)

json_list <-output %>% fromJSON()

我在python脚本中使用了另一个线程的代码:

^{pr2}$

因为我的Json字符串格式不好。在

相关问题 更多 >

    热门问题