网状:无法配置python3

时间:2018-09-20 04:36:45

标签: python r python-3.x reticulate

我正在使用onclick R软件包,并希望使用它配置click,但是无法做到这一点。我尝试了以下代码

reticulate

请提示。

1 个答案:

答案 0 :(得分:2)

运行

use_python(python = "/usr/bin/python", required = TRUE)

,然后配置为python3。如here所述,R会话仅允许使用一个python解释器。

如果仅将use_python配置为python3,这就是我在笔记本电脑上看到的内容:

library(reticulate)
use_python(python = Sys.which("python3"), required = TRUE)
py_config()

# python:         /usr/local/bin/python3
# libpython:      /usr/local/Cellar/python3/3.5.2_1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/config-3.5m/libpython3.5.dylib
# pythonhome:     /usr/local/Cellar/python3/3.5.2_1/Frameworks/Python.framework/Versions/3.5:/usr/local/Cellar/python3/3.5.2_1/Frameworks/Python.framework/Versions/3.5
# version:        3.5.2 (default, Jul 28 2016, 21:28:00)  [GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)]
# numpy:          /usr/local/lib/python3.5/site-packages/numpy
# numpy_version:  1.12.0
# 
# NOTE: Python version was forced by use_python function