一般系统内,默认 python 对应 python 2.x 而 python3 对应 python 3.x
# 查询 Python 2.x 的路径
Sys.which('python')
# 查询 Python 3.x 的路径
Sys.which('python3')
先看系统内有哪些 Python 环境可用
# 查看 Python 环境信息
reticulate::py_config()
然后指定用哪个,我比较推荐先自己创建虚拟环境,然后使用 use_virtualenv
或 use_condaenv
指定虚拟环境,做开发肯定用得着
如何创建虚拟环境参考 https://pythonguidecn.readthedocs.io/zh/latest/dev/virtualenvs.html