1

I am trying to use reticulate in R.

In bash I get:

which python
# ~/.pyenv/shims/python

But when I set it in R I never get it to work. Could someone help me understand why?

library(reticulate)
my_python='~/.pyenv/shims/python'
use_python(my_python, required = T)  # throws no message
py_config() #throws error below
#Error in initialize_python(required_module, use_environment) : 
# Python shared library not found, Python bindings not loaded.

Note that I made sure that ~/pyenv/shims/ is in $PATH.

Thanks a lot for the help in advance

2
  • There is a dot missing before pyenv? Commented Jun 25, 2019 at 13:44
  • Sorry, I missed it when writing the post. In my R code I had included it Commented Jun 25, 2019 at 13:46

1 Answer 1

3

I faced the same problem, after a lot of searching I stumbled upon this. Hopefully it will help: https://github.com/rstudio/reticulate/issues/291#issuecomment-437143751

From another poster in the same thread: "You need to use a version of Python built with the dynamically loadable library (.dylib). R can't link to a static Python library."

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.