为了账号安全,请及时绑定邮箱和手机立即绑定

网状:无法配置python3

网状:无法配置python3

桃花长相依 2021-06-14 21:31:28
我正在使用reticulateR 包并想python3用它进行配置,但无法做到。我尝试了以下代码library(reticulate)packageVersion("reticulate")# [1] ‘1.10.0.9002’use_python(python = "/usr/bin/python", required = TRUE)py_config()# python:         /usr/bin/python# libpython:      /usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so# pythonhome:     /usr:/usr# version:        2.7.15rc1 (default, Apr 15 2018, 21:51:34)  [GCC 7.3.0]# numpy:          /usr/lib/python2.7/dist-packages/numpy# numpy_version:  1.13.3## NOTE: Python version was forced by use_python functionSys.which("python3")# python3 # "/usr/bin/python3" use_python(python = "/usr/bin/python3", required = TRUE)py_config()# python:         /usr/bin/python# libpython:      /usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so# pythonhome:     /usr:/usr# version:        2.7.15rc1 (default, Apr 15 2018, 21:51:34)  [GCC 7.3.0]# numpy:          /usr/lib/python2.7/dist-packages/numpy# numpy_version:  1.13.3# # NOTE: Python version was forced by use_python function任何提示,请。
查看完整描述

1 回答

?
慕妹3242003

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


查看完整回答
反对 回复 2021-06-22
  • 1 回答
  • 0 关注
  • 152 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信