![]() ![]() Lets try installing a usefull package (this will be installed to the “r-reticulate” environment). You can easily install packages directly through reticulate. # /Users/jfranco1/anaconda/envs/general/bin/python ![]() # /Users/jfranco1/anaconda/envs/r-reticulate/bin/python # numpy: /Users/jfranco1/anaconda/envs/r-reticulate/lib/python3.6/site-packages/numpy # pythonhome: /Users/jfranco1/anaconda/envs/r-reticulate:/Users/jfranco1/anaconda/envs/r-reticulate # libpython: /Users/jfranco1/anaconda/envs/r-reticulate/lib/libpython3.6m.dylib ![]() It should be 3.6… py_config() # python: /Users/jfranco1/anaconda/envs/r-reticulate/bin/python We can have a final check of the Python version being used. If changing the conda environment doesn’t work, try changing the path direclty using: use_python("Path.", required=TRUE) The same is true whenever you type py_config() instead of py_discover_config(). This means that you need to restart R if you want to change the Python version. Once you run use_condaenv("relevantenv") Python is loaded. ![]() If the Python version is not the one from the relevant anaconda environment change the environment by typing use_condaenv("relevantenv") It might be the case that you had an older Python version installed and that reticulate is pointing to this older version (remember you need a recent version of Python - e.g Python 3.6.5-). Once installed we need to call in the package: library(reticulate) Now you are ready to install the reticulate package: install.packages("reticulate") Install RStudio v1.2 preview release - The new version of RStudio will fix some bugs. In order for the current package of reticulate to work out of the box I recommend to follow these instructions: Reticulate is quite recent and many bugs with RStudio have been solved in the last month, so I recommend installing the latest versions of everything we need. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |