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: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found when loading Pandas #1467
Comments
This is fundamentally a binary incompatibility between conda-provided and not-conda-provided binaries. There are various workarounds for the very motivated (you're on the right path with virtualenv_create() |
I'll give making a new one a shot, but I do have a degree of version controlling I need to do regarding the Might I ask real quick what the argument would look like to say, install pandas=2.0.3 Or better yet, pass a environment.yml to the command to set all of that up? |
either of these should work: virtualenv_create(packages = "pandas==2.0.3")
# or
virtualenv_create(requirements = "path/to/requirements.txt") |
Thanks much! Will give it a shot. |
So this makes the environment but it doesn't install the packages. Futher, it puts in the home directory and I'd rather it be in the pwd (e.g. Could you show a command that's a little more specific as to how to do this? I'm not seeing anything jump out in the documentation. requirements.txt is attached, but adapted from an environment.yml so the |
library(reticulate)
# First, make sure python 3.10 is installed on the system.
if (is.null(virtualenv_starter("3.10")))
install_python("3.10:latest")
# create the requirements.txt file for pip
cat(file = "requirements.txt", "
numpy==1.23.4
oauthlib==3.2.2
pandas==1.5.3
")
virtualenv_create("./venv", version = "3.10", force = TRUE,
requirements = "requirements.txt") Alternatively, instead of creating a requirements file, you can pass the packages directly to the virtualenv_create(
"./venv",
version = "3.10",
force = TRUE,
packages = c(
"numpy==1.23.4",
"oauthlib==3.2.2",
"pandas==1.5.3"
)
) (( It's hard to tell if the oauthlib version dependency is actually worth pinning - my guess is you may want to either unpin it, (simply replace "oauthlib==3.2.2" with "oauthlib") or if it's being pulled in as a dependency of another package, remove it completely and let pip handle picking the appropriate version )) |
I also managed to get it working with something like this: Thank you so much for your patience. |
Just to further complicate things, it appears that this still isn't pointing to the correct library path (probably because I used the existing mamba environment tools to create reticulate environment). It looks something like this in the .Rprofile:
However, regardless of whether I force the version using
Am I going to need to do a fresh install of 3.10 for this to work? |
Can you please paste the full output you see after running the code I provided in my previous comment?
You're using a conda build of python here to create the virtual env from, don't do that. It defeats the purpose of switching away from conda environments. Install python through one of these methods:
Also, it seems that you're using two approaches to python installation management, those provided by reticulate and others provided by renv. They overlap but are not identical, and serve different needs. Based on the error message above, it seems renv is setting My recommendation is to get it working without renv in the mix, and then introduce renv once you have everything working. |
The ones from your previous comments look like this:
The latest throws the following:
I don't have I can also confirm the |
This is a surprising error - you should not need |
I'm guessing that with this older version of RHEL, you/IT must be installing such a recent version of R manually, perhaps using https://github.com/rstudio/r-builds. While this issue is in flight, I suggest working on taking a similar approach with installing a more recent version of Python, perhaps using the sister repo: https://github.com/rstudio/python-builds/ |
This error is due to the ancient version of pip that comes with the RHEL system. You can work around this by calling virtualenv_create(..., packages = FALSE)
system2(virtualenv_python("r-reticulate"), "-m pip install --upgrade pip wheel setuptools") |
I'm seeing a different error with
|
We've hit similar issues in the past related to Our work around for this was to use the POSIT package managers for the RStudio-Server sessions: e.g. And so far, this is the only way we have been able to get There may be a way to get a pre-compiled version of Will comment back if I find anything related to that after I try a few more of your suggestions. |
So despite seemingly calling
But it seems to be defaulting to the
You think it might help to shut off the base environment? I'm honestly not sure what's passing the |
Nope. Still doing that even with the base option turned off:
Probably going to have to figure out what's mapping that automatically either way. |
Some common locations where
|
It was that last one. |
So as an update. I did the following to create a In the bash terminal:
But once I toss it into the workflow to try and read the
I think it has to do with pip refusing to let me install But I'm not sure what direction I can take it from here outside of asking my IT dept to install a new python version from the tarball. |
It looks like the version of pandas you are trying to work with does not work with Python 3.6, and requires a more recent version of Python. I know this is easier said than done in bureaucracies, but I would say: insisting on having reasonably up-to-date software is, well, a very reasonable request. Python versions 3.6 and 3.7 are both EOL. https://devguide.python.org/versions/. You can probably download and compile python yourself manually (perhaps using an older version of pyenv). You can also try to put a band-aid over the binary incompatibility with conda by setting LD_PRELOAD for the appropriate .so before starting R, or maybe, by calling |
I tried a suggestion similar to that with the following: In this case, I used But that creates it's own problems. Primarily:
|
system pip version does not support `--no-user` (as seen in #1467)
Is this fix operating on the local I'm still working this out with IT. |
I believe I will have to work within python itself to get around this in the interim until this is resolved. Feel free to close the issue for the moment. |
Hi Experts.
I have seen this posted a few times but I haven't seen a clear answer, so forgive me if reposting (see: https://community.rstudio.com/t/reticulate-issues-in-rstudio-server/16555 & https://stackoverflow.com/questions/49875588/importerror-lib64-libstdc-so-6-version-cxxabi-1-3-9-not-found & #428)
I am trying to load a .pickle file with a pandas dataframe into
R
withreticulate
.However, whenever I try to import
pandas
, the following error gets thrown:#Error
Which I assume stems from trying to call the "default" library path on the server where our RStudio-Server instance is initialized.
I have tried multiple methods to address this in both the rmarkdown in the
Quarto
document I'm using, and the.Rprofile
that is called prior to initializing any part of the project as described below:However, the error seems to persist regardless of what path redirection I may call or what environment variables I may actively set.
Would anyone know how I might be able to address this error?
Any help would be greatly appreciated.
Below is the versioning information for the RStudio-Server session, R installation, py_config() output, and server OS.
RStudio Server
R Version
py_config() output:
OS Version:
The text was updated successfully, but these errors were encountered: