-
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
py_run_file_impl() crashing since .v1.27 #1422
Comments
Is there any output before the session crashes? (perhaps there might be some additional output if you run this outside the RStudio IDE?) Can you reproduce this outside of conda? (i.e., if you install python from www.python.org or using |
No, nothing.
I have only a conda installation available currently and I tried multiple python versions and changing MKL to openblas for numpy, without effect. |
I can't reproduce this locally. Can you provide any additional information?
|
I'm having the same problem on Windows 10. I'm running R 4.1.2.
I've already attempted to remediate this unknown "fatal error" crash (with no details coming from anywhere) by updating reticulate to the dev version, updating my Rstudio, and running reticulate::install_python() and forcing the new installation to be sourced by reticulate as shown above. I've also installed numpy and pandas using py_install() but somehow, it's not finding numpy. The moment I attempt to "source_python()", there is a bomb, fatal crash of R. I also have traced the failure to the py_run_file_impl(). The file I'm attempting to source is a simple import and declaration of a function:
|
What is the name of the python file? |
add_columns.py |
I've now removed all Python installations, and attempted another reticulate driven install of miniconda, created a conda environment, installed numpy, scipy, and pandas, and then attempted source_python() and the exact same blow up |
what is the output from |
Can you please provide the full file path when you do |
"C:/Documents and Settings/eugen/Documents/JobRepo/Bitscopic/pre_covid19_clustering_workflow/python/add_columns.py" Still bombs Normalize path gives:
It would be really nice if I could figure out how to monitor what is breaking. The logs aren't showing any errors. It just crashes. There is code that I haven't touched or edited at all that is bombing since I updated Rstudio. With all the people that work on python, it blows my mind how terrible the error handling is. Nevermind the terrible difficulty it is to manage python errors while working with Rstudio. I have no clue how to troubleshoot this except to blow away my entire computer's software installations and reinstall everything and start from scratch... in fact, I've already tried this with the python install, uninstalling miniconda, destroying all folders in my documents, updating to the dev version of reticulate, allowing reticulate to manage the re-install of miniconda. Still, source_python() bombs everytime. |
|
|
Can you please update Rcpp? (probably a good idea to update any other outdated packages as well... |
I thought it might be related to the UNWIND_PROTECT changes with Rcpp 1.0.10. But after rolling back Rcpp to 1.0.7, I still can't reproduce the issue. |
Don't know what to say. I updated Rcpp. When the rsession restarts by invoking Rstudio, the following error shows up:
Still can't do anything without a bomb. Still have no way of figuring out what is causing this bomb. I can begin a console session, I can call the reticulate library, I can tell reticulate to use the r-reticulate conda environment, and I can successfully run |
Before you do all that, can you please
update.packages(check = TRUE, ask = FALSE)
remotes::install_github("rstudio/reticulate", force = TRUE)
reticulate::virtualenv_create(force = TRUE) |
I came across similar situation. I guess the error comes from the UNC paths. See the errors below: |
- Returns a `PyObjectPtr`, not just a `SEXP`. - remove forward declaration; not needed. Related to #1422
I tried a local UNC path and still can't reproduce the error. |
Thank you for the quick reply. I tried the commands that you have suggested above, the details are shown below:
It works for updating the packages.
It updated the reticulate into version ‘1.31.0.9000’.
|
It is worth to mention that the reticulate::repl_python() and reticulate::import() function works, only the reticulate::source_python() function will crash the system. See details below:
|
It looks like creating the
|
The suggested two commands do not work. See details below.
Thus, I re-install the r-reticulate environment using conda, it works. See details below.
However, reticulate::source_python() function still crashes the system |
The
RETICULATE_PYTHON
is pointing topython.exe
in a conda environment. After thatreticulate::source_python('file.py')
is called and R crashes. The file can be empty. This happens since v1.27 and above (tested till v1.30). The crash happens both on console, as in RStudio. v1.26 works fine.I have traced it down to
py_run_file_impl()
. Here is a compare between v1.26 and v1.27. I don't immediately see what is causing the crash:The text was updated successfully, but these errors were encountered: