I've been trying to install RPy2 on MacOS Sierra, for Python 3.6 but the pip installation fails without compiling.
The installation errors out with the message:
clang: error: unsupported option '-fopenmp'
error: command 'clang' failed with exit status 1
Any help with the installation would be appreciated.
rpy2 will typically require an R version that is not much older than itself. This means that even if your system has R pre-installed, there is a chance that the version is too old to be compaible with rpy2. At the time of this writing, the latest rpy2 version is 2.8 and requires R 3.2 or higher.
Installing rpy2 You must have Python >=3.7 and R >= 4.0 installed to use rpy2 3.5. 2. Once R is installed, install the rpy2 package by running pip install rpy2 . If you'd like to see where you installed rpy2 on your machine, you can run python -m rpy2.
rpy2 is an interface to R running embedded in a Python process. on Pypi. Questions and issues. Consider having a look at the documentation. Otherwise questions should preferably be asked on the rpy mailing-list on SourceForge, or on StackOverflow.
Found the solution in this thread.
env CC=/usr/local/Cellar/gcc/X.x.x/bin/gcc-X pip install rpy2
Running the above command by replacing the gcc version with the latest version on your machine should solve the problem. For example, on my mac, I ran
env CC=/usr/local/Cellar/gcc/8.2.0/bin/gcc-8 pip install rpy2
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