-
Notifications
You must be signed in to change notification settings - Fork 332
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
conda_python()
point to unexpected Python directory
#1480
Comments
Is the path you're supplying to |
oh sorry my bad, it does have the starting slash in my issue, just a typo here on the issue description |
In general, |
the bad thing is RStudio starts crashing whenever I run any function even py_config() or py_eval |
Can you run in R terminal? (( segfaults are sometimes unavoidable with conda, if possible I would encourage switching to a virtual environment )). |
Hi Tomasz, Thank you for your waiting. The weird thing is that my code can run absolutely error-free in R Terminal. Well, I am starting to get confused right now. The executable code is provided as follows:
Which returns:
|
The problem was solved when I switched into virtualenv as per your recommendation, the context is as follows:
There is only 1 inconvenient problem left, as you may see, the libpython, which sources from a previously created conda environment - Could you please introduce me to how to configure the shared option as there are multiple libraries that have been installed? |
It looks like you created the venv using a conda python. Can you please install python using
Then library(reticulate)
install_python("3.10:latest")
virtualenv_create("my-venv", version = "3.10") |
Hi Tomasz, Just so you know – the problem is solved using your recommendation. I think the issue came from RStudio since it cannot address the correct Python path and pathlib, specifically in Thank for your support. |
Hi, I recently tried to use
reticulate
to leverage my Python script in the R environment. Unfortunately, I encountered an annoying error when trying to set up Python utilizing the conda environment - the RStudio is continuously aborted and restarts whenever I trypy_config()
. The following context describes my situation:Conda version
Python version
As you might notice, I tried to use a conda environment named
r_py_310
installed byminiforge3
and utilizing Python version 3.10. This environment is initialized under the configuration ofCONDA_SUBDIR=osx-arm64 conda create -n $@
, which means it is subjected to be compatible with the Mac M1 chip (arm64 architect). I follow this tutorial to create ther_py_310
environment.R session info
And here is how I detect the error, it seems to be partially similar to this issue 385.
Sys.setenv("RETICULATE_PYTHON"="user_path/opt/anaconda3/envs/r_py_310/bin/python")
library(reticulate)
use_condaenv('r_py_310', conda = "/user_path/miniforge3/condabin/conda")
py_available()
, which returnsFALSE
py_available()
, it only points to theif (is_python_initialized()) return(.globals$py_config$available)
. To be honest I don't really understand what is the root cause.py_discover_config()
, which returns:conda_python()
, it returns "/user_path/Library/r-miniconda-arm64/envs/r-reticulate/bin/python", which is definitely the default Python path ofr-reticulate
virtual environment.In conclusion, I think that it cannot initialize the conda environment and falls back to the default installed virtual environment of the
reticulate
package causing the conflict which leads to the crash of RStudio. I could not find any further information as the RStudio IDE crashed immediately without any explanation.Hope you guys can help on this, to me it is really frustrating.
The text was updated successfully, but these errors were encountered: