More information for the below issue: I have now tried this on a variety of OS 
and Python configurations, with the only one that worked being Python3.8 on 
Ubuntu. In all cases, the install of R and the eseis module was new, with the 
install of eseis accomplished via running the “install.packages(‘eseis’)” 
command in R. Also, in all cases eseis loaded fine in R - it is only rpy2 that 
had issues with the library.

Configurations tried:

CentOS 7, python 3.6
Ubuntu 20, python 3.8
MacOS X Catalina 10.15.7 Python 3.9.5
MacOS X Catalina 10.15.7 Python 3.8.9
MacOS X Big Sur 11.2 Python 3.9.5
MacOS X Big Sur 11.2 Python 3.8.10

So from the test with ubuntu, I know this library *can* work, but most of the 
time it does not (unless I can figure out what’s different about the ubuntu 
install…Something about third-party shared libs, perhaps?)
---
Israel Brewster
Software Engineer
Alaska Volcano Observatory 
Geophysical Institute - UAF 
2156 Koyukuk Drive 
Fairbanks AK 99775-7320
Work: 907-474-5172
cell:  907-328-9145

> On Jun 17, 2021, at 1:11 PM, Israel Brewster <ijbrews...@alaska.edu> wrote:
> 
> A coworker of mine provided me with some R code that I need to integrate into 
> my python code, for which purpose rpy2 appears to be ideal. Overall it seems 
> to work as desired, except for when the code tries to use the “eseis” module. 
> When trying to load (if that’s the correct terminology for R…) that one 
> module, I get a segfault.
> 
> Loading the same module from an R session works fine, the segfault only 
> occurs when loading through rpy2. Does anyone have any idea how I can fix 
> this?
> 
> Python: 3.9.5 on Mac OS X Catalina 10.15.7
> R version 4.1.0
> rpy2 version 3.4.5
> 
> When loading library from python/rpy2:
> 
> Python 3.9.5 (v3.9.5:0a7dcbdb13, May  3 2021, 13:17:02) 
> [Clang 6.0 (clang-600.0.57)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from rpy2.robjects.packages import importr
> >>> importr('eseis')
> zsh: segmentation fault  python3.9
> 
> 
> But from R from the same console session:
> 
> 
> R version 4.1.0 (2021-05-18) -- "Camp Pontanezen"
> Copyright (C) 2021 The R Foundation for Statistical Computing
> Platform: x86_64-apple-darwin17.0 (64-bit)
> 
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type 'license()' or 'licence()' for distribution details.
> 
>   Natural language support but running in an English locale
> 
> R is a collaborative project with many contributors.
> Type 'contributors()' for more information and
> 'citation()' on how to cite R or R packages in publications.
> 
> Type 'demo()' for some demos, 'help()' for on-line help, or
> 'help.start()' for an HTML browser interface to help.
> Type 'q()' to quit R.
> 
> > library("eseis")
> Welcome to another bright 'eseis' session.
> > q()
> 
> ---
> Israel Brewster
> Software Engineer
> Alaska Volcano Observatory 
> Geophysical Institute - UAF 
> 2156 Koyukuk Drive 
> Fairbanks AK 99775-7320
> Work: 907-474-5172
> cell:  907-328-9145
> 

_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to