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

pymer4 not backwards compatible with rpy2~=3.0.5 #41

Closed
ingrid88 opened this issue Jul 26, 2019 · 7 comments
Closed

pymer4 not backwards compatible with rpy2~=3.0.5 #41

ingrid88 opened this issue Jul 26, 2019 · 7 comments

Comments

@ingrid88
Copy link

ingrid88 commented Jul 26, 2019

The rpy2 library depricated the ri2py function and now instead uses rpy2py so i get this error

AttributeError: module 'rpy2.robjects.pandas2ri' has no attribute 'ri2py'

When i run through the tutorial here http://eshinjolly.com/pymer4/usage.html at model.fit()

@ejolly
Copy link
Owner

ejolly commented Jul 29, 2019

Thanks for opening this issue! Unfortunately, as the sole developer of this project, it's hard for me to keep up with numerous API changes that rpy2 introduces with each version. To get going right away, I would suggest pip install rpy2==2.9.4 to force using a non 3.0 rpy2 version which should work.

@yanst001
Copy link

yanst001 commented Aug 6, 2019

ok, I found this issue is similar to the one I have and tried to switch to 2.9.4. I do not see error for rpy2==2.9.4 installation, but there is import error when the Lm, Lmer4 are imported as below (I do not have import error when using rpy2==3.0.5).

Can you add some documentation about how to avoid errors with requiring an older version of rpy2 than current default.

ImportError: dlopen(/usr/local/lib/python3.6/site-packages/rpy2/rinterface/_rinterface.cpython-36m-darwin.so, 2): Library not loaded: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libR.dylib
  Referenced from: /usr/local/lib/python3.6/site-packages/rpy2/rinterface/_rinterface.cpython-36m-darwin.so
  Reason: image not found

@ejolly
Copy link
Owner

ejolly commented Aug 6, 2019

@yanst001 Thanks for reporting this. It looks like this is an rpy2 issue not a pymer issue as rpy2 cannot find your R installation. How did you install R? Via conda or manually? And did you still version 3.5 (what rpy2 is looking for)? This can happen if you install some R related things through conda, and others manually; mixing and matching generally is best avoided. I have some instructions in the documentation for installation issues that might help with this.

Unfortunately I’m currently finishing up my dissertation so I won’t be able to get to updating the documentation until then. I do have a big update release planned for after that with numerous fixes and hopefully easier installation.

@yanst001
Copy link

yanst001 commented Aug 6, 2019

It seems a simple change from ri2py to rpy2py, I guess this can be done locally?

@yanst001
Copy link

ok, my solution was to shift fully converted to rpy2 , this takes some time to use specific R function in python, but works

@ejolly
Copy link
Owner

ejolly commented Oct 30, 2019

Sounds good. You can also try the latest release (pushed minutes ago) version 0.7.0. Lots of bug and compatibility fixes that work with the latest rpy2 version

@ejolly
Copy link
Owner

ejolly commented Oct 30, 2019

I'm going to close this for now, but can revisit if there are still problems

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