RPy2应用程序iis部署问题

2024-09-29 17:14:57 发布

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

我已经开发了一个Python REST应用程序。在VisualStudio中运行应用程序时,所有功能都正常工作。但是当我部署到iis服务器时,除了一个涉及RPy2的方法之外,所有的方法都在工作。你知道吗

该特定方法包含以下代码。你知道吗

r("library(e1071)")
r("library(kernlab)")
r.assign("traindata",traindf)
r.assign("testdata",testdf)
r("model <- ksvm(X{0} ~ ., data = traindata, kernel = 'rbfdot', degree = 3, coef0 = 0, cost = 1, nu = 0.5, na.action = na.omit, scale = TRUE)".format(testtopicid))
results = r("result <- predict(model, testdata)")

我从Python代码中得到的一个例外是

Error in library(e1071) : there is no package called 'e1071'

似乎这个错误消息是来自R

我怀疑iss路径设置有问题。你知道吗

你能帮我解决这个问题吗。你知道吗


Tags: 方法代码功能rest应用程序model部署library

热门问题