问题描述
我正在尝试从R连接到Athena.设置"RAthena"并建立连接后,出现此错误:
I am trying to connect to Athena from R. After setup 'RAthena' and connection, I got this error:
Error: Boto3 is not detected please install boto3 using either: `pip install boto3` in terminal or `install_boto()`.
Alternatively `reticulate::use_python` or `reticulate::use_condaenv` will have to be used if boto3 is in another environment.
因此,通过使用 pip install
,我在Python 2和Python 3中都安装了 boto3
.
So by using pip install
, I installed boto3
in both Python 2 and Python 3.
Requirement already up-to-date: boto3 in ./Library/Python/2.7/lib/python/site-packages (1.12.39)
Requirement already satisfied: boto3 in ./Library/Python/3.7/lib/python/site-packages (1.12.39)
但是在 R
中,我仍然遇到相同的错误.然后,我尝试在 R
中使用 install_boto()
.它告诉我要执行以下操作:
But in R
, I am still having the same error. Then I tried using install_boto()
in R
.It tells me to do as follow:
Installation complete. Please restart R.
然后,我将永远留在此 Restarting R session ...
输出中,永远不会看到任何有关成功重启的注释.最后, R
仍然无法检测到 boto3
.
Then I would stay in this Restarting R session...
output forever and never see any note for successful restart.And at the end, R
still can't detect boto3
.
推荐答案
很遗憾听到您对 RAthena
包有疑问.您能告诉我您正在运行哪个版本的软件包.
really sorry to hear you are having issue with the RAthena
package. Can you let me know what version of the package you are running.
您是否尝试通过 reticulate
设置要使用的python?例如:
Have you tried setting which python you are using through reticulate
? For example:
library(DBI)
# specifying python conda environment
reticulate::use_condaenv("RAthena")
# Or specifying python virtual enviroment
reticulate::use_virtualenv("RAthena")
con <- dbConnect(RAthena::athena())
您还可以检查是否安装了 numpy
吗?我记得,如果 numpy
不在其中,则 reticulate
可以更好地绑定到python环境.
Can you also check if numpy
is installed, I remember reticulate
can bind to python environments better if numpy
is apart of it.
或者,您可以使用 noctua
. noctua
的功能与 RAthena
完全相同,但不是使用python的 boto3
,而是使用R的 paws
包.
Alternatively you can use noctua
. noctua
works exactly the same as RAthena
but instead of using python's boto3
it uses R's paws
package.
如果您仍在挣扎,我可以在Github上提出这个问题.我以为我已经通过向安装函数 install_boto
添加 numpy
来解决了此问题,但是我很高兴重新打开此问题.
If you are still struggling I can raise this as an issue on Github. I thought I had resolved this issue by adding numpy
to the installation function install_boto
, however I am happy to re-open this issue.
这篇关于在R中,即使安装了Boto3,也没有Boto3连接Athena的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!