Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues on Mac OS Mojave with rpy2 install #5

Open
jlevy44 opened this issue Aug 21, 2019 · 9 comments
Open

Issues on Mac OS Mojave with rpy2 install #5

jlevy44 opened this issue Aug 21, 2019 · 9 comments

Comments

@jlevy44
Copy link
Member

jlevy44 commented Aug 21, 2019

rpy2 cannot seem to find original R install path (R 3.6 installed but looking for 3.5 path specific to older mac os):

pymethyl-preprocess -h
Traceback (most recent call last):
 File "/Library/Frameworks/Python.framework/Versions/3.7/bin/pymethyl-preprocess", line 11, in <module>
   load_entry_point('pymethylprocess==0.1.4', 'console_scripts', 'pymethyl-preprocess')()
 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
   return get_distribution(dist).load_entry_point(group, name)
 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
   return ep.load()
 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2443, in load
   return self.resolve()
 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2449, in resolve
   module = __import__(self.module_name, fromlist=['__name__'], level=0)
 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pymethylprocess/preprocess.py", line 8, in <module>
   from pymethylprocess.PreProcessDataTypes import *
 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pymethylprocess/PreProcessDataTypes.py", line 8, in <module>
   import rpy2.robjects as robjects
 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/rpy2/robjects/__init__.py", line 16, in <module>
   import rpy2.rinterface as rinterface
 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/rpy2/rinterface/__init__.py", line 51, in <module>
   from rpy2.rinterface._rinterface import (baseenv,
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/rpy2/rinterface/_rinterface.cpython-37m-darwin.so, 2): Library not loaded: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libR.dylib
 Referenced from: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/rpy2/rinterface/_rinterface.cpython-37m-darwin.so
 Reason: image not found

Issue documented here:
https://bitbucket.org/rpy2/rpy2/issues/503/cannot-use-rpy2-in-macos-mojave
Related: https://bitbucket.org/rpy2/rpy2/issues/403/cannot-pip-install-rpy2-with-latest-r-340
Possible solution: https://bitbucket.org/rpy2/rpy2/issues/487/library-not-loaded-usr-local-opt-r-lib-r

Finds R 3.6 with python3 -m rpy2.situation

@jnhutchinson
Copy link

jnhutchinson commented Sep 5, 2019

Your "possible solution" appears to be working for me on both CentOS and OSX. Namely:

pip uninstall rpy2
pip install wheel
pip install rpy2

Thanks!

@jlevy44
Copy link
Member Author

jlevy44 commented Sep 6, 2019

Thanks @jnhutchinson ! Glad it worked for you.

@CurtisPetersen Does this help with your install?

I'm going to keep this issue open for now and see if anyone else has been experiencing this problem and if these solutions seem to work. The install has been fine for me on my Mac.

A nice alternative is running Docker, I can update the pymethylprocess distribution if need be.

@shucon
Copy link

shucon commented Oct 26, 2020

Is there a reason to use rpy2 2.9.4 instead of the latest version? It's causing me errors
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I./rpy/rinterface -c ./rpy/rinterface/r_utils.c -o build/temp.linux-x86_64-3.6/./rpy/rinterface/r_utils.o ./rpy/rinterface/r_utils.c:24:22: fatal error: Rdefines.h: No such file or directory compilation terminated. error: command 'gcc' failed with exit status on my linux system
PS: I am working on a server and can't use Docker on it. Would be great if this issue is fixed soon.

@jlevy44
Copy link
Member Author

jlevy44 commented Oct 27, 2020

@shucon do you have singularity on your server? you should be able to run Docker through that container service, if not I will look into that issue and see if I can update the package to utilize rpy3. Though it maybe useful to check out issues for rpy2, as it seems to have difficulties locating your compiler

@shucon
Copy link

shucon commented Oct 27, 2020

@jlevy44 I'm afraid we don't have singularity on the server. The only way for me to get it running is inside a python virtualenv. I checked out why rpy2 is not working, and I agree it's a problem related to locating the compiler. Unfortunately, I can't use those fixes as I don't have sudo access and I'm pretty sure that the sysadmin won't do any changes for this.

@jlevy44
Copy link
Member Author

jlevy44 commented Oct 29, 2020

What happens if you install rpy2 >=3.0 and then reinstall pymethylprocess with --no-deps? @shucon
That can help me debug a bit and upgrade any old rpy2 2.9 calls to >=3 within pymethylprocess

@jlevy44
Copy link
Member Author

jlevy44 commented Oct 29, 2020

The main reason why I used rpy2 2.9 was because that was what was available when I created the package and there appeared to be incompatibilities when 3 came out. I agree it is a long needed upgrade though.

@shucon
Copy link

shucon commented Oct 30, 2020

Hey @jlevy44 thanks for the help. The sysadmin installed singularity on the server. If it's not an urgent issue you can skip it.
Thanks a lot :D

@jlevy44
Copy link
Member Author

jlevy44 commented Nov 1, 2020

Sounds good. Nice to hear the software is working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants