-
Notifications
You must be signed in to change notification settings - Fork 327
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
reticulate:::initialize_python() kills R outside R studio #758
Comments
Doing some Rcheology shows that the problem disappears with version of reticulate < 1.14 (1.10, 1.11, 1.12, 1.13 works, but not 1.14 or 1.15). |
If you haven't already, it would be worth trying to reinstall both Rcpp and reticulate together. |
I did try, also with older versions of Rcpp and devel... no luck. Only downgrading reticulate to 1.13 or earlier does the job. Rcpp does not seem to be the issue. Yet, I have used reticulate until a week ago without issues and I usually have all my packages up to date. I don't get it... |
I have installed R 4.0 and took the opportunity to reinstall all pkgs from scratch -> same issue... :-( |
Salut Alexandre, if you want, we can try this later today (like, 4pm or so?), although I'm of course not @kevinushey :-) LMK if you'd like to (if so mail to my first name @ rstudio.com) |
@skeydan I managed to make gdb work, but then when running
Any idea? |
yeah... you should have seen several messages saying |
Hmmm... would love to but i have no idea: it tells me
And I am not surprise he does not find the file with the symbols because I am not on Simon Urbanek computer. |
hm, I see ... well... then perhaps it's best to ask @kevinushey how other Mac users do it (obtain the debug version) |
I think you need to use |
Thanks @kevinushey & @skeydan, I can make lldb work (yay!) but then the issue disappear because... I tested a couple of times and it seems reproducible:
You may be able to solve that in reticulate since old version do work... Otherwise, do you think using a non-notarized version of R is the cleanest workaround? I wonder also if changing some security setting specifically for R could help. In any case, if your SIP is off, perhaps this is why you did not see this on your system. In hindsight that explains why I had no problem before, despite already using the version 1.14 which is now problematic, an MacOS update must have triggered the problem. Here are some info on my test system (I can provide more upon request):
Ping @lizimai |
Yikes!! That is not expected. I wonder if R or Python are built / notarized with restrictions that prevent us from using Python in the way we do? I'll have to re-enable SIP and see if there's anything we can do here. Indeed, the simplest workaround would be to use a non-notarized version of R, either built from sources yourself or an official non-notarized build from CRAN. However, I'm not sure if those are available yet :-/ I will try to find time to see if I can reproduce this issue with SIP enabled with R 4.0.0. |
A non-notarized version of R is at http://mac.r-project.org/high-sierra/R-4.0-branch/x86_64/R-4.0-branch.tar.gz, mentioned at https://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html 10.17 |
Only with that version have we been able to run python modules obtained from a miniconda installation. This has been an issue for the Bioconductor basilisk package by @LTLA. |
Many thanks for the tip @vjcitn (I will try installing this R version, despite using MacOS 10.15 and not 10.13), but I am hoping that @kevinushey will find a more user-friendly solution. I am optimistic because in RStudio's console it does work, so there seem to be a way to make it work with a notarized version of R. |
I vaguely recall it being possible to see the actual issue logged in Console.app, although I forget exactly how to find it (filtering through the various logs on macOS is kind of challenging). But it should at least tell you which entitlement was missing. |
It must be that log file: |
Thanks! Copying the relevant bits of the crash log:
In other words, the application is crashing because the code signature in the version of Intel MKL being loaded is invalid. The version I have in my installation appears valid:
Can you share the output of:
for posterity? |
You might also need to ensure that Conda / the MKL package is up to date. |
|
I only have MKL and Conda through r-miniconda as automatically installed by RStudio... I tried that to update, but it did not update Conda or MKL nor improved the situation: > reticulate::miniconda_update()
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done
## Package Plan ##
environment location: /Users/alex/Library/r-miniconda
added / updated specs:
- conda
The following packages will be downloaded:
package | build
---------------------------|-----------------
libffi-3.2.1 | h0a44026_6 43 KB
ncurses-6.2 | h0a44026_1 749 KB
sqlite-3.31.1 | h5c1f38d_1 2.4 MB
tqdm-4.45.0 | py_0 58 KB
------------------------------------------------------------
Total: 3.3 MB
The following packages will be UPDATED:
libffi 3.2.1-h475c297_4 --> 3.2.1-h0a44026_6
ncurses 6.2-h0a44026_0 --> 6.2-h0a44026_1
openssl 1.1.1f-h1de35cc_0 --> 1.1.1g-h1de35cc_0
sqlite 3.31.1-ha441bb4_0 --> 3.31.1-h5c1f38d_1
tqdm 4.44.1-py_0 --> 4.45.0-py_0
Downloading and Extracting Packages
sqlite-3.31.1 | 2.4 MB | ########## | 100%
libffi-3.2.1 | 43 KB | ########## | 100%
ncurses-6.2 | 749 KB | ########## | 100%
tqdm-4.45.0 | 58 KB | ########## | 100%
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done |
The codesign output looks the same as what I've got as well. :-/ Do you have the latest version of Xcode / Apple command line tools installed? |
I think so: I have XCode Version 11.4.1 (11E503a) which seems very recent. |
I'll just mention that |
I've also found this same issue running on Mac OS Catalina. I am running bookdown on a set of Rmd files that have python chunks, and it works fine within RStudio but not using Rscript or in R running from a terminal. In fact, reticulate:::initialize_python() causes non-RStudio R to crash. If I disable the SIP, it works. Of note, I do have the notarized version of R installed. I'm running: |
I found this issue by searching for the I noticed that running This worked for me to avoid getting more of these
This thread might help to learn more about what is going on: |
I think I'm running into the same issue. Reticulate works fine in RStudio but when I tried running with Rscript/R it fails:
|
sessionInfo()? haven't seen this in quite some time. |
I just did what this person recommended and it worked! |
I have been having the same issue, no bugs in Rstudio, but crashes when loading conda versions of python in the terminal or R GUI. This fix does work for me too, but the reason I'm using python is for PyTorch, which depends on mkl, mkl-service. Is there a way that I can do a similar fix, but still be able to use PyTorch? (I'm not an expert on these kinds of things, so I apologize if the answer is hiding in plains sight.) Thanks so much regardless! |
Hi all, sorry if the issue exists already (could not spot it).
On 2 different computers on MacOS managed by 2 different users (me and @lizimai), reticulate:::initialize_python() creates R to crash (=kill) with R from r.app, R in the console, R in RStudio accessed through devtools menu (e.g. through test() or check()) but NOT in the R console inside RStudio.
Example in RStudio:
In R from terminal (using Rscript here but also using R properly):
Running the problematic call directly, I could verify this behaviour using the same arguments everywhere. Indeed, this
crashes everywhere except in the R console within RStudio.
I replicate this with both the current devel version (1.15-9000) of reticulate and the CRAN version.
Any idea what could be going on?
The text was updated successfully, but these errors were encountered: