Loading numpy via reticulate in R gives an error and shows the wrong version of numpy

I am using the reticulate package in R to take advantage of certain Python packages. However, when I try and import numpy, it gives the following error:

Error: ImportError: Unable to import required dependencies:
numpy:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  • The Python version is: Python3.10 from “/data/user/home/yongw/.conda/envs/anndata/bin/python”
  • The NumPy version is: “1.20.3”

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: No module named ‘numpy.core._multiarray_umath’

Even installing a new version of numpy into my Anaconda environment doesn’t fix the error, the same numpy version is being used. How can I fix this?

One of the module dependencies loaded with the R/4.2.0-foss-2021-bare module on Cheaha is SciPy-bundle/2021.05-foss-2021a. This module contains outdated Python libraries including the NumPy 1.20.3 modules seen in the error message. Unfortunately, R will default to trying to use these python packages for everything even if you’ve installed newer versions in an activated Anaconda environment.

To fix the issue, include the following line in your Environment Setup window when requesting an RStudio job: module unload SciPy-bundle/2021.05-foss-2021a