I have seen this question answered for issues in Windows but haven't seen any solution for a Mac.
After installing keras like:
devtools::install_github("rstudio/keras")
library(keras)
install_keras()
I get the error when running:
library(keras)
mnist <- dataset_mnist()
>> Error in initialize_python(required_module, use_environment) :
Python shared library not found, Python bindings not loaded.
I have tried the following:
use_python("/Users/me/anaconda3/bin/python3.7", required = TRUE)
use_virtualenv("~/MyFolder/.venv/")
use_python("~/MyFolder/.venv/bin/python")
But haven't been successful, I saw some suggestions about wrong python installation but it shouldn't be it in my case. i have installed python 3.7.5 with Anaconda
=> python --version
Python 3.7.5
I'm on macOS Catalina Version 10.15.1 in RStudio, Version 1.2.5019. Does anyone have any solution?
You may encounter the following error when deploying Python content to RStudio Connect: A workaround is to downgrade to virtualenv 16.1.0 and remove the associated Python environments in /var/lib/rstudio-connect/python-environments by running the following commands: where X.Y.Z is the version of Python you are using.
If you are working on your local machine, you can install Python from Python.org or Anaconda. If you are working on a server with RStudio Workbench (previously RStudio Server Pro), your administrator can install a system-wide version of Python, or you can install Python in your home directory from Python.org or Anaconda.
This error will usually manifest by a Jupyter Notebook in Connect not having the dependencies you expect from the development environment. You can confirm this by adding the following lines as part of the notebook and generating the report again in RStudio Connect.
Installing Python from source will result in a standalone Python environment that is separate from the system/framework installation of Python that won't be affected when you update system packages.
This is a old thread, but just wanted to say for anyone that finds this that installing the python-dev package for whatever version of python you're using may work. I was using python3.8, so I installed python3.8-dev
I had same problem with OSX. Found solution by configuring python virtual environment to use python3
library(reticulate)
use_python("/usr/local/bin/python3")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With