1 回答
TA贡献1824条经验 获得超6个赞
不要不运行
use_python(python = "/usr/bin/python", required = TRUE)
在配置成python3. 正如这里所讨论的,一个 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
添加回答
举报