find_python | R Documentation |
If you are using the {rosettaPTF} package for the first time you will need to have Python installed to obtain the necessary modules. You can set up {reticulate} to install into a virtual or Conda environment. Usually {reticulate} should cover most or all of the setup.
find_python(
envname = NULL,
pypath = NULL,
arcpy_path = getOption("rosettaPTF.arcpy_path")
)
envname |
As in |
pypath |
Optional: Path to |
arcpy_path |
Optional: Path to ArcGIS Pro Python installation. For example: |
If you have Python set up correctly you should be able to run reticulate::py_config()
or reticulate::py_discover_config()
and discover your shared library.
A common problem with {reticulate} is not pointing at the correct (or any) python
binary or libpython
shared library. Use reticulate::use_python("/path/to/python", required = TRUE)
to set the path or, alternately, be sure python
can be found on your PATH. {reticulate} has a preference for Python environments that have numpy
installed.
Use reticulate::install_miniconda()
if you'd like to install a Miniconda Python environment. Conda is default on Windows.
For devices with limited ability to install new software that have ArcGIS Pro installed (some USDA computers), this method can look for a Python installation in "C:/Program Files/ArcGIS/Pro/bin/Python/envs/arcgispro-py3"
and Conda executable in "C:/Program Files/ArcGIS/Pro/bin/Python/Scripts"
. The base file path to "Python" directory can be customized using the arcpy_path
argument.
On Linux and OS X you can create a virtual environment using reticulate::virtualenv_create()
. The default environment name will be "r-reticulate"
.
character path to python
or NULL
if no suitable environment can be found. The result is stored as the package option rosettaPTF.python_path
.
find_python()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.