Hello. I have been trying hard to change the path of the Python in my Mac since py_available() keeps returning FALSE.
I've tried the methods here and someone recommended me to change through use_python() with miniconda path, but still no use. I have the Python 3.7.1 in miniconda. So I also tried going through use_condaenv() but still remain the same with the py_available() FALSE.
Here's the config return in RStudio:
`> py_config()
python: /usr/bin/python
libpython: /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.dylib
pythonhome: /System/Library/Frameworks/Python.framework/Versions/2.7:/System/Library/Frameworks/Python.framework/Versions/2.7
version: 2.7.10 (default, Oct 6 2017, 22:29:07) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]
numpy: /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy
numpy_version: 1.8.0
python versions found:
/usr/bin/python
/Users/inger.noire/miniconda3/bin/python`
Many thanks.
@herboratory
I suggest you add RETICULATE_PYTHON config to ~/.Renviron
echo "RETICULATE_PYTHON = /your_python_3.7.1/bin/python" > ~/.Renviron
which can automatically launch all Python session from this engine after you re-login the session.
@harryprince thanks for your reply. But I now got the problem as follow:
`> py_available()
[1] FALSE
py_config()
Error in py_discover_config(required_module, use_environment) :
Python specified in RETICULATE_PYTHON (/your_python_3.7.1/bin/python) does not exist`
I tried forcing RETICULATE_PYTHON but am also still getting py_available == false...
> Sys.getenv("RETICULATE_PYTHON")
[1] "C:\\Users\\markn\\AppData\\Local\\Programs\\Python\\Python38\\python.exe"
> py_available()
[1] FALSE
>
(Note: the double-\ are an artifact of escaped slashes. Copying/pasting from Sys.getenv() produces:
RETICULATE_PYTHON C:\Users\markn\AppData\Local\Programs\Python\Python38\python.exe
Checkout issue #45, the comment by @bryanhanson worked with me:
run this (with required = TRUE)
library("reticulate")
use_python('<PATH_TO_PYTHON>', required = TRUE)
before anything else
@DanaJomar, Thanks for your suggestion. I tried but no use...sigh
@DanaJomar I can also confirm this solution no longer works. Reticulate 1.11.1
Most helpful comment
@herboratory
I suggest you add RETICULATE_PYTHON config to ~/.Renviron
which can automatically launch all Python session from this engine after you re-login the session.