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
Code gets hung up trying to run get_coherence() on gensim coherence model #1430
Comments
Hi, Sorry, I can't reproduce the problem in my setup. Does this happen in a quarto notebook, or simply executing the code line by line in the IDE? |
Hi, thanks so much for looking into this. This also happens when running chunk by chunk in an Rmarkdown, so I don't believe the issue is related directly to Quarto. And this doesn't happen when running chunk by chunk in a Jupyter Notebook without Reticulate in VS Code.
|
I'm not sure if this is helpful, but I just tried running the quarto doc in vscode.
|
Hmm that's helpful. I believe this can be related to: Lines 248 to 251 in 383d4e7
not propagating correctly. |
To reproduce the error we just need to call
Here is a snippet, (copy pasted from https://docs.python.org/3/library/multiprocessing.html) that produces the error
|
A more minimal MRE: Process <- reticulate::import("multiprocessing")$Process
p <- Process(target = function() cat("HI\n"))
p$start() Which gives output:
Interestingly, it drops you into a fresh R session, which you can interact with, and then exit, returning back to the launching R session. Calling
|
It looks related to: #1458, it should find the correct Python executable, right? |
I think that issue was specific to the My current guess is that https://github.com/python/cpython/blob/c494fb333b57bdf43fc90189fc29a00c293b2987/Lib/multiprocessing/spawn.py#L88C61-L88C61 is creating a cmdline that launches R instead of Python. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This is where the executable get reset to the 'wrong' Rterm.exe - looks like a special branch for virtual environments on Windows: |
Fixed on main now. Please try the development version: remotes::install_github("rstudio/reticulate") |
I just tried it and it worked! Thanks so much!! |
I have a quarto document in Rstudio in which I'm using reticulate. I'm able to train an LDA model and get a coherence model, but once I try to get the coherence score, the code never stops running and doesn't produce an error code. I have to force quit R. This same code runs in Jupyter Notebook without issue.
reprex:
My memory usage still shows 50% unused.
I'm using R version 4.2.3, Rstudio 2022.12.0 Build 353, Quarto version 1.2, Python 3.10.4, and reticulate 1.30
The text was updated successfully, but these errors were encountered: