-
Notifications
You must be signed in to change notification settings - Fork 328
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
ImportError: `GLIBCXX_3.4.30' not found #1282
Comments
I ran into a similar situation when I was trying to import xgboost in R with reticulate, while xgboost import was perfectly fine in Python REPL. TL;DRThe problem seems to be stemming from different libstdc++.so.6 being called between R (& reticulate) and Conda/Python. (Note for those who are not familiar including myself: this post (https://unix.stackexchange.com/a/557929) had nice explanations on what exactly are libstdc++.so.6, GLIBCXX_*, ...) In your case As far as I can see, there are couple of potential solutions. Only the last one worked for me.
It would be super nice if reticulate package can detect this kind of incompatibility and flag this in a warning message. |
https://stackoverflow.com/questions/58424974/anaconda-importerror-usr-lib64-libstdc-so-6-version-glibcxx-3-4-21-not-fo |
执行这个命令就可以了: conda install -c conda-forge gcc=12.1.0 |
This is due to a binary incompatibility between conda and the R installation. The most straightforward solution is to switch from conda to virtual environments, which don't suffer from the same problem. library(reticulate)
install_python("3.10:latest")
virtualenv_create("r-scipy", version = "3.10", packages = "scipy") (( The less straightforward solution is to have conda provide the R binary and all R packages. Note that this approach means that you can't use pre-built packages from CRAN or RStudio builds provided by Posit. )) |
- add support for importing modules from various locations - R CMD Check and tests are passing - Note: Metworx does not support "pandas" via a conda environment. It seems to stem from different libstdc++.so.6 versions being called between R and conda/python. A virtual environment may not have this issue, but using the pre-set path to python avoids this issue within conda environments. See more details here: rstudio/reticulate#1282
this command is ok: conda install -c conda-forge gcc=12.1.0 |
I also recommend to switch to virtual env, that's the only solution that solved the
|
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve. I tried Finally, I find the solution It can works. |
This issue is not specific to reticulate. I've written a comprehensive overview on stackoverflow explaining what is happening here and possible ways to fix it. |
I think this is the most robust way, particularly when you are working on a server. |
Running
gives the following error:
It might be a path issue. The created miniconda enviroment by reticulate is sound.
And the included
libstdc++.so.6
in the miniconda enviroment does contain the GLIBCXX_3_4.30 string.reproduction:
environment
The text was updated successfully, but these errors were encountered: