Closed atombaby closed 3 years ago
If numpy is a requirement, the SciPy-Bundle will have to loaded. SciPy loads a base Python package. Also Note that I am only building one version of Python per toolchain. When loading Python and R the toolchains need to match.
The last two core versions of Python modules have been updated to define RETICULATE_PYTHON. These two packages overlap with the last 13 versions of R that are available. Users should load SciPy-Bundle to ensure that NumPy is available.
Python/3.8.2-GCCcore-9.3.0
Python/3.8.6-GCCcore-10.2.0
Cool thanks- just as an aside, there isn't an explicit requirement for numpy in reticulate. It's somewhere in the function py_discover_config
that attempts to load numpy.
If the user's code doesn't require numpy, reticulate shouldn't.
As per our last discussion, we should set RETICULATE_PYTHON when we load a Python module.
The reticulate R library (part of the R module) won't use the python from the base python module as there isn't a numpy install in the base python module. For example, if you load:
And then start R and run:
The python used is from some other location:
If we force the issue with the environment variable:
The
py_discover_config()
function returns:The reticulate docs indicate that:
In this case,
py_discover_config
attempts to load numpy but fails with the bare-bones Python module.Setting RETICULATE_PYTHON forces Reticulate to use the loaded module. The environment variable has no other impacts so should be safe to set even if Reticulate isn't used.