Skip to content Skip to sidebar Skip to footer

Rstudio Discovers Python Pyenv Installation, But I'm Unable To Run Python Processes

I'm trying to run Python in RStudio. I have installed Python 3.8.5 via pyenv, and created a virtual environment with pyenv virtualenv (which I call venv-Rstudio) in my RStudio proj

Solution 1:

After posting my question, this question appeared in the Related list, and this answer by @nucholab solved my problem. In short, re-installing Python with pyenv using the following command enables shareable libraries:

env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.8.5 

After that and re-creating my virtual environment (and for the record, installing numpy), loading Python in RStudio works as expected:

> py_config()
python:         /Users/my_username/.pyenv/versions/3.8.5/envs/venv-Rstudio/bin/python
libpython:      /Users/my_username/.pyenv/versions/3.8.5/lib/libpython3.8.dylib
pythonhome:     /Users/my_username/.pyenv/versions/3.8.5:/Users/andreas/.pyenv/versions/3.8.5version:3.8.5 (default, Oct  22020, 13:54:11)  [Clang 12.0.0 (clang-1200.0.32.2)]
numpy:          /Users/my_username/.pyenv/versions/3.8.5/envs/venv-Rstudio/lib/python3.8/site-packages/numpy
numpy_version:1.19.2tensorflow:     [NOT FOUND]

NOTE: Python version was forced by RETICULATE_PYTHON

Post a Comment for "Rstudio Discovers Python Pyenv Installation, But I'm Unable To Run Python Processes"